Nullish Coalescing Operator (??) In Javascript
The nullish coalescing operator returns the left hand side if it is not null or undefined, otherwise it returns the right hand side. This makes it different from the logical OR (||) operator which returns the right hand side if the left side is falsey. Let’s see some examples to see exactly the behavior.
It is important to note that the operator only returns the right hand side if the left hand side is null or undefined – but not false:
Contrarily the logical OR returns the right hand side if the left side is just “falsey”.
Read more about it here