# js对象属性名书写方式

### Notation of Keys

var test = {
'case': 'I am a keyword so I must be notated as a string',
delete: 'I am a keyword too so me' // raises SyntaxError
};


Object properties can be both notated as plain characters and as strings. Due to another mis-design in JavaScript's parser, the above will throw aSyntaxError prior to ECMAScript 5.

This error arises from the fact that  delete is a keyword; therefore, it must be notated as a string literal to ensure that it will be correctly interpreted by older JavaScript engines.

• 本文已收录于以下专栏：

举报原因： 您举报文章：js对象属性名书写方式 色情 政治 抄袭 广告 招聘 骂人 其他 (最多只允许输入30个字)