According to definition nullish assignment , assign only if variable is null or undefined. However the same can also be done using OR operator as shown in the below example. Where should we exactly use nullish assignment operator over logical OR operator?
let a = null;
let b = undefined;
a ||= 10;
console.log(a); // output: 50
b ||= 'string is empty.';
console.log(b); // output: "string is empty."
let a = null;
let b = undefined;
a ??= 10;
console.log(a); // output: 50
b ??= 'string is empty.';
console.log(b); // output: "string is empty."