When creating an object containing a key value pair, binding that to a variable and then accessing that property, it works fine:
var b = { foo: 'value' };
b.foo;
// "value"
If I create a similar object, directly access its property and bind that to a variable, it works as well:
var b = { foo: 'value' }.foo;
b;
// "value"
However, when submitting the following code to the console, this results in an error:
{ foo: 'value' }.foo;
// Uncaught SyntaxError: Unexpected token '.'
Why?