I knew that {}
is either an object or a block of code, but today my co-worker asked me why {foo: 1}
works when entered into the console, but {foo: 1, bar: 2}
generates an error.
Why does foo: 1
evaluate in the console to 1
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…