I\'m confused what the object[foo]
term is referring to. Any hints? I know that bar[\'unique_prop\']
and bar.unique_prop
refers to
object[foo] = 'value';
attempts to use an object as a member name, this causes a .toString()
call so;
'value'
is assigned to object["[object Object]"]
, when you attempt to read alert(object[bar]);
the same toString()
occurs as bar
is also an object, so you reference object["[object Object]"]
once again and get back 'value
'.