JavaScript evaluation order when assigning

Viewed 499

At what point does JavaScript determine the left-hand side of an assignment — is it before or after the right-hand side is evaluated?

For example, what does this code do?

var arr = [{thing:1},{thing:2},{thing:3},{last:true}];
arr[arr.length - 1].newField = arr.pop();
2 Answers
Related