In Chrome 63.0 and Firefox 58.0, it seems that adding an index to the object literal does not allow the object to be parsed.
{"a":"b"} 17:37:32.246 {a: "b"} {"a":"b"}["a"] 17:37:36.578 VM288:1 Uncaught SyntaxError: Unexpected token :
Can someone explain why the parser doesn't parse this the way I do? (I think there should be a mistake in my specification implementation ...) It seems that this is not a parsing of the object.
An environment in parentheses results in a syntactically correct expression:
({"a":"b"})["a"] 17:42:03.993 "b"
javascript syntax grammar
user234461
source share