Introduction
What is the output of the following code?
var a = 1;
var b = 2;
var c = 3;
a = b = c;
console.log(a);
console.log(b);
console.log(c);
3
3
3
Note
"=" is right to left associative.
b = c gets called first and then a = b.
PreviousNextRelated