If I run {"a": "b", "c": "d"}.a in a browser (tested in Chrome and Firefox), I get SyntaxError: Unexpected token ':'. But if I run it in Node.js, it works as expected. If I put it in a function call, such as console.log({"a": "b", "c": "d"}.a), now it works fine even in the browser.
What's going on here?