Browser support for using a reserved word as a property name in JavaScript

后端 未结 4 1040
一个人的身影
一个人的身影 2020-11-30 09:06

I\'m trying to use \"for\" as an object property name. It seems to work fine in IE7, IE8, Firefox, Chrome and Opera, but apparently not in Safari.

My understanding

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-30 09:45

    There is a table showing browser support for ECMAScript 5 features here: http://kangax.github.com/es5-compat-table/

    Reserved words can be used as property names in IE9, Firefox 3.5+ and Chrome 7+, Safari 5.1+.

提交回复
热议问题