Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on ECMAScript for XML - Direct XML Syntax in ECMAScript. Parent comment
for(in) existed in JS, and the semantics were never going to be changed, that wasn't something that was on the table or was ever considered.
However other languages have syntaxes like:
for each (...) foreach (...) for ( .. : .. )
We couldn't use `foreach` or `for each` as they conflicted with e4x - one directly, the other by being sufficiently similar to not be plausible.
More depressingly for(:) was killed because of the zombie "typed JS" proposal.
There are no comments on this comment yet.
for(in) existed in JS, and the semantics were never going to be changed, that wasn't something that was on the table or was ever considered.
However other languages have syntaxes like:
All of which would be more consistent and wouldn't require a non-reserved word be reserved in one context.We couldn't use `foreach` or `for each` as they conflicted with e4x - one directly, the other by being sufficiently similar to not be plausible.
More depressingly for(:) was killed because of the zombie "typed JS" proposal.