javascript - Questions about tostring conversion
三叔
三叔 2017-07-05 10:56:24
0
4
859

三叔
三叔

reply all(4)
学霸

Objects cannot be alerted directly to see the things inside the object. You can use for (key in obj){alert(key + ':' + obj[key]) to see things}

Ty80

Because what you output is an object, the objects popped up by alert are all object objects. You write alert(JSON.stringify(obj)) like this, otherwise use JSON.parse(obj)

世界只因有你

The parameter type in alert() is character type. When the incoming data type is incorrect, the toString() method will be automatically called for implicit conversion.
So the full form of alert(obj) here is:
alert(Object.prototype.toString().call(obj))
This involves using the call method for type detection,
You can refer to: https://developer. mozilla.org...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!