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...
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}
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...