The following will show in Firebug or in jsconsole.com or in other Javascript interactive console:
>>> foo = { a : 1, b : 2.2 }
Object { a=1, more...}
>>> foo.a
1
>>> foo.b
2.2
>>> { a : 1, b : 2.2 }
SyntaxError: invalid label { message="invalid label", more...}
>>> { a : 1 }
1
why is the 1
returning for {a : 1}
and why is {a : 1, b : 2.2}
giving an error? In Ruby, they would come back the same way you defined it.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…