Is assigned expression always evaluated even if not needed?
yukulele opened this issue · 3 comments
yukulele commented
in this example:
let a = 0;
let b = true;
b = b || a++;
console.log(a); // 0
a++
is not evaluated.
in this case:
let a = 0;
let b = true;
b ||= a++;
console.log(a); // ?
should a++
be executed?
ljharb commented
No, see #3 (comment)
jridgewell commented
No, a
will be 0
.
jridgewell commented