However, with the square bracket notation the property name doesn't have to conform to the naming conventions. That's what is happening. An object can be given some property names that cannot be accessed by the "dot" method.
:o thanks Tcobb...but I don't know why this is illegal.
[INDENT]Section 7.3. Objects as Associative Arrays
You've seen the . operator used to access the properties of an object. It is also
possible to use the  operator, which is more commonly used with arrays, to
The important difference to note between these two syntaxes is that in the first,
the property name is an identifier, and in the second, the property name is a
string. You'll see why this is so important shortly. [/INDENT]