Why can't I directly access a property of an object literal?

Viewed 906

Why the following syntax

{a:1,b:2}.constructor

is invalid, whereas

[1,2].constructor 

is valid?

2 Answers
Related