Better HN
topnewbestaskshowjobs
Log inSign up

langguage

4 karma · joined May 17, 2024 (2y ago) · 3 submissions

Submissions

comment 2y ago · link · parent

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

comment 2y ago · link · parent

95% of these questions are irrelevant, even if you never develop in anything but this language. They tell us nothing. It’s not a useful set of questions for any purpose and there’s no insight here

comment 2y ago · link · parent

That’s not true. If it appears true it’s because you’re using a repl that treats the first part as a separate statement and returns the value of the second part as the most recent statement, but there’s literally nowhere you can encounter the behaviour you described in a JavaScript program