Then we can still use words that got reserved in ES5.
In ES3, they aren't reserved so everything goes well and in ES5, they
are allowed to be used that way.

On Mon, Aug 29, 2011 at 6:01 PM, Lasse Reichstein
<[email protected]> wrote:
>
>
> On Sun, Aug 28, 2011 at 1:38 PM, Skateside <[email protected]> wrote:
>>
>> You can't use reserved words as variables or function names. You can
>> use them as object properties, but only if they're passed in as a
>> string (by wrapping them in quotation marks)
>
> Actually, in ES5, you can use them unquoted as keys in object literals and
> in property access/
>
>>
>> var o = {delete: true}; // causes an error because delete is a
>> reserved word.
>> o.delete; // same error as before.
>
> I.e., neither of these throw an error in ES5 (which is in all current
> version browsers).
>
>>
>> var o = {"delete": true}; // fine.
>> o['delete']; // true
>
> That's still allowed too.
>  /L
>
> --
> To view archived discussions from the original JSMentors Mailman list:
> http://www.mail-archive.com/[email protected]/
>
> To search via a non-Google archive, visit here:
> http://www.mail-archive.com/[email protected]/
>
> To unsubscribe from this group, send email to
> [email protected]
>

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to