这篇文章主要讲解 js进行类型判断 Object.prototype.toString.call()
首先看一段ECMA中对Object.prototype.toString的解释:
Object.prototype.toString( )
When the toString method is called, the following steps are taken:
- Get the [[Class]] property of this object.
- Compute a string value by concatenating the three strings “[object “, Result (1), and “]”.
- Return Result (2)