查验数据类型
ifType = text => Object.prototype.toString.call(text).replace("[object",'').replace(/\]/,'').trim();
console.log(
ifType([]), // Array
ifType({}), // Object
ifType(null), // Null
ifType(undefined), // undefined
ifType("1"), // String
ifType(0), // Number
ifType(new Set()) // Set
)
typeof原理 -- https://www.cnblogs.com/thaipine/p/10750402.html
instanceOf详解 -- https://blog.youkuaiyun.com/weixin_40013817/article/details/103182967