In objects, property names are always strings.

and...

If you use any other value besides a string (primitive) as the property, it will first be converted to a string.

(You don't know JS - this & object prototypes)

That is, doing this:

obj[true] = 'foo';  

is in fact equivalent to:

obj['true'] = 'foo';