ivomota
9/27/2014 - 1:45 AM

Types in Javascript How to detect the data type of anything

Types in Javascript How to detect the data type of anything

var type_of = function(x) {
    var type = Object.prototype.toString.apply(x);
    return type.slice(type.indexOf(' ') + 1, -1);
};