I met a problem at chrome.

Why it cause a syntaxError? I have tried it in nodejs, it is ok.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With