BTW, if you know that a property name is foo, why would you ever code obj["foo"] instead of obj.foo?

The most obvious reason is if the name of the property contains a character which cannot be an identifier character in the property name... like a unicode character, for instance.


Without private names there is no particular reason to say obj['foo'] rather than obj.foo but there is a very important distinction between obj[foo] and obj.foo.

Are we talking about the difference between obj['foo'] and obj[foo]? I think perhaps that was a subtle shift in this conversation that I missed until just now?

Without private names, is there (and what is it?) an important distinction between:
1. obj[foo] and obj.foo; AND
2. obj['foo'] and obj.foo


--Kyle


_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to