File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change 8383 var item = {};
8484 ` ` `
8585
86- - Don' t use [reserved words](https ://developer.mozilla.org/en-US/docs/JavaScript/Reference/Reserved_Words ) as keys.
86+ - Don' t use [reserved words](http ://es5.github.io/#x7.6.1 ) as keys. It won ' t work in IE8 . [More info](https : // github.com/airbnb/javascript/issues/61)
8787
8888 ` ` ` javascript
8989 // bad
9090 var superman = {
91- class: ' superhero' ,
9291 default: { clark: 'kent' },
9392 private: true
9493 };
9594
9695 // good
9796 var superman = {
98- klass: ' superhero' ,
9997 defaults: { clark: 'kent' },
10098 hidden: true
10199 };
102100 ` ` `
101+
102+ - Use readable synonyms in place of reserved words.
103+
104+ ` ` ` javascript
105+ // bad
106+ var superman = {
107+ class: 'alien'
108+ };
109+
110+ // bad
111+ var superman = {
112+ klass: 'alien'
113+ };
114+
115+ // good
116+ var superman = {
117+ type: 'alien'
118+ };
119+ ` ` `
103120 ** [[⬆]](#TOC )**
104121
105122## < a name= ' arrays' > Arrays< / a>
You can’t perform that action at this time.
0 commit comments