4 ms·
That’s not the claim that was made. That code can not be evaluated to produce that value by any rules of the language. It can only be evaluated to produce that
by langguage 2y ago
That’s not the claim that was made. That code can not be evaluated to produce that value by any rules of the language. It can only be evaluated to produce that result by a repl which is parsing it as statements and then evaluating the most recent statement, in a non-standard way, but in the language itself two consecutive statements do not have a defined evaluation, and in any context where it is being evaluated it would gramatically need to be parsed as a single expression instead.
If that’s not correct you can provide a counter example
- DangitBobby 2y agoconsole.log(eval('{a:1}["a"]'))