javascript - Object literals behaves weird in the console -
In the JavaScript console (I'm using Chrome), the expression {}
is passed to Undefined
. If I execute var a = {}
, expression evaluates a
to object {}
. Why does {}
not evaluate expression in the object {} in
?
Even further, evaluating {a: 4}
to 4
, and expression {a: 4, b: 5} }
is apparently the wrong syntax.
{}
is not an object < / P>
A block statement is used to group zero or more statements. The block has been delimited with a pair of curly bracket.
Comments
Post a Comment