The nullish coalescing operator (??) is a logical operator that returns its right-hand side operand when its left-hand side operand is null or undefined and otherwise returns its left-hand side operand.
The logical OR operator (II) is an operator that returns the right-hand side operand if the left operand is any falsy value, not only null or undefined.
const foo= null ?? "string";
console.log(foo);
// expected output: "string"
const number @ ?? 42;
console.log(number);
// expected output: 0
const number1 @ ?? 12;
console.log(number1);
//expected output 0
const number2= 0 || 12;
console.log(number2);
//expected output 12 Because || operator is a logical operator
and boolean value for 0 is false