loading...

re: Logical assignment operators in JavaScript VIEW POST

FULL DISCUSSION
 

Hi! I'm not sure -- isn't x ||= y the same as x = x || y ? This is aligned to how other operators (+=, *=, etc.) do work.

 

x ||= 1 would mean x || (x = 1)

 

Aren't the two expressions x = x || y and x || (x = y) equivalent?

Code of Conduct Report abuse