js判断object的具体类型(或者说判断object的类class)
The JavaScript specification gives exactly one proper way to determine the class of an object:
Object.prototype.toString.call(t);
http://bonsaiden.github.com/JavaScript-Garden/#types
https://stackoverflow.com/questions/7893776/the-most-accurate-way-to-check-js-objects-type
The typeof
operator doesn't really help us to find the real type of an object.
I've already seen the following code :
Object.prototype.toString.apply(t)
Question:
Is it the most accurate way of checking the object's type?