三种方法(typeof、constructor、Object.prototype.toString.call())
①
typeof
typeof('123') === "string" // true
typeof '123' === "string" // true
②
constructor
'123'.constructor === String // true
③ Object.prototype.toString.call()
Object.prototype.toString.call('123') === '[object String]' // true
858

被折叠的 条评论
为什么被折叠?



