Logical assignment, For of loop & Optional chaining
Logical assignment
The logical assignment operator in JavaScript is &&= and ||= . Let me explain it through the code below.
let x = 0;
let y = 1;
console.log(x&&=y); // executes as x && (x=y), returns 0
console.log(x||=y); // executes as x || (x=y), ...
aashman.hashnode.dev3 min read