Tekkaman

导航

 

Javascript Property Names】  

  Property names must be strings. This means that non-string objects cannot be used as keys in the object. Any non-string object, including a number, is typecasted into a string via the toString method.

  

  This outputs "value", since 1 is type-casted into '1'.

  

  This also outputs "value", since both foo and bar are converted to the same string. In the SpiderMonkeyJavaScript engine, this string would be "['object Object']".

参考:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_Accessors

posted on 2017-02-09 10:43  Tekkaman  阅读(245)  评论(0编辑  收藏  举报