Assignment result
importance: 3
What are the values of a
and x
after the code below?
let a = 2;
let x = 1 + (a *= 2);
The answer is:
a = 4
(multiplied by 2)x = 5
(calculated as 1 + 4)
What are the values of a
and x
after the code below?
let a = 2;
let x = 1 + (a *= 2);
The answer is:
a = 4
(multiplied by 2)x = 5
(calculated as 1 + 4)