摘要:
今天看了一同事写的代码,又长见识了,今天学习到如何靠谱地知道对象值的内置类型。 方法是:Object.prototype.toString.call( ); Object.prototype.toString.call('') --> [Object String] Object.prototype.toString.call([]) --> [Object Array] Object.prototype.toString.call({}) --> [Object Object] Object.prototype.toString.call(Function) 阅读全文