function getType(target) { return Object.prototype.toString.call(target).slice(8, -1); }
getType(123); getType('string'); getType(true); getType(undefined); getType(null); getType({}); getType([]); getType(function () {}); getType(/123/); getType(new Date());
|