What does [object Object] mean?

后端 未结 10 2034
醉酒成梦
醉酒成梦 2020-11-22 03:22

I am trying to alert a returned value from a function and I get this in the alert:

[object Object]  

Here is the JavaScript code:



        
10条回答
  •  遥遥无期
    2020-11-22 04:02

    You are trying to return an object. Because there is no good way to represent an object as a string, the object's .toString() value is automatically set as "[object Object]".

提交回复
热议问题