我在 chrome 上遇到了问题。
为什么会导致语法错误?我在nodejs中试过了,没问题。
In the context in which you are running (and the Chrome and Node REPLs have different default contexts) it, the {
character starts a block, not an object literal.
You can't follow a string with a :
in a block.
If you were to say ({ "a": 1 })
you would change the context so it would be an object literal.