JavaScript 1.7, the version used in Firefox 2.0, has
a raft of Python-inspired features, including generators and list comprehensions. So now, you can do things like:
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.)