var getType = function(obj) { if (obj == null) { return String(obj); } return typeof obj === 'object' || typeof obj === 'function' ? obj.constructor && obj.constructor.name && obj.constructor.name.toLowerCase() || /functions(.+?)(/.exec(obj.constructor)[1].toLowerCase() : typeof obj; };