Using reserved words as property names, revisited

后端 未结 4 1278
臣服心动
臣服心动 2020-11-28 09:27

Can a reserved word be used as an object\'s property name?

This issue was raised indirectly in a previous Stack Overflow question: Browser support for using a reserv

4条回答
  •  北海茫月
    2020-11-28 10:12

    Yes, in most browsers (including IE9+)

    There's actually an entry in the Kangax compatibility table for "Reserved words as property names"

    http://kangax.github.io/compat-table/es5/#test-Object/array_literal_extensions_Reserved_words_as_property_names

提交回复
热议问题