function fib() {
var i = 0, j = 1;
while (true) {
yield i;
[i, j] = [j, i + j];
}
}
and
var evens = [i for (i in range(0, 21)) if (i % 2 == 0)];And, indeed, bulk assignments, like:
[a, b] = [b, a];That is, as long as you're not concerned about your code working on non-Mozilla web browsers. (I wonder whether Microsoft, who still have well over 80% of the browser market, will adopt these new features.)
Please keep comments on topic and to the point. Inappropriate comments may be deleted.
Note that markup is stripped from comments; URLs will be automatically converted into links.