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
is a keyword;
therefore, it must be notated as a string
literal to ensure that it will be correctly interpreted by older JavaScript engines.
delete