“If there are any calculations to the right of the
= operator, those are performed before the value is assigned to the variable on the left of the operator.”
I am unclear what this ^^ means. is this saying that calculations attached to a variable will be executed before the variable is assigned another calculation?
It means that if there is any expression (eg. 2 + 2) after the assignment operator(=). Then, the expression will be calculated first and after that the variable that is before the assignment operator (=) will have the result of the expression stored in it.
var sum = 2 + 2;
// 4 will be logged as the variable value.
(The variable “sum” will have 4 as it’s value after the line of the code gets executed).
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.