In objects, property names are always
string
s.
and...
If you use any other value besides a
string
(primitive) as the property, it will first be converted to astring
.
(You don't know JS - this & object prototypes)
That is, doing this:
obj[true] = 'foo';
is in fact equivalent to:
obj['true'] = 'foo';