One day I saw certain way to swap elements in array. Like this:
var arr = [1,2,3];
arr[0] = [arr[1], arr[1] = arr[0]][0];
Obviously this method assume that first value of temporary array arr[1] will be calculated before second arr[1] = arr[0].
Otherway both values will be the same. Synthetic example:
var x = 1;
var arr = [x, x += 1, x += 1];
arr; // [1,2,3] or [3,3,2] or maybe [3,2,3]?
Is there any guarantees that javascript interpreter will not act in this manner?