What does the object[foo] term mean?

后端 未结 3 1045
孤独总比滥情好
孤独总比滥情好 2021-01-21 02:34

I\'m confused what the object[foo] term is referring to. Any hints? I know that bar[\'unique_prop\'] and bar.unique_prop refers to

3条回答
  •  不要未来只要你来
    2021-01-21 03:31

    It is the same as object.whatever_x_is where x is foo.toString() which will be the same as bar.toString() since (unless overridden) calling toString on a generic object will generate a generic "is an object" string such as "[object Object]"

提交回复
热议问题