3 ms·
I speculate that this is because Javascript takes stuff from Self where loops are functions. So probably Javascript was meant to write something like: while(fu
by iopq 13y ago
I speculate that this is because Javascript takes stuff from Self where loops are functions.
So probably Javascript was meant to write something like:
while(function(k) { ++i; return i < k; });
where the while function would call the closure until it got false at which point the while function itself would return
so having var declarations be hoisted was not a problem in this syntax because everything (including if and while) would have its own scope due to being a function
- kragen 13y agoYou could have designed a language like that, but Brendan didn't.