DEV Community

Discussion on: Logical assignment operators in JavaScript

Collapse
 
andreasloukakis profile image
Andreas Loukakis

Imho, it would be important to emphasise on ??= checking for null and undefined, while ||= checking for falsy values. Could save some bugs :D

Same as:
0 || 42 // 42
0 && 42 // 0
0 ?? 42 // 0

Collapse
 
hemanth profile image
hemanth.hm