JavaScript evaluation order when assigning
问题 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(); 回答1: The left-hand side of an assignment operator is evaluated first. The specification for this as of ES2015 can be found in the "Runtime Semantics: Evaluation" portion of the "Assignment Operators" section and can be very