|
|
|
|
|
by jakear
2245 days ago
|
|
Huh that’s quite interesting. It behaves this way even when you explicitly make it an object literal rather than a block. I guess JS’s parser explicitly prohibits adding things to a curly-brace enclosed entity? I’m normally quite defensive of JS, but I’ll have to admit I don’t like that. |
|
Did you try to do this?
That's interpreted as the statement 1 labeled a, not as an object. This makes it obvious it's not an object: JavaScript supports labels so you can continue/break multiple levels at once: