let type = function(t) { var p = ({}).toString.call(t); var typeObj = { "[object Object]": "Object", "[object Array]": "Array", "[object Number]": "Number", "[object String]": "String", "[object Function]": "Function", "[object Boolean]": "Boolean", "[object Null]": ‘Null‘, "[object Undefined]": "Undefined" } return typeObj[p] ? typeObj[p] : false; };