JavaScript
JavaScript mixed ?? with || or && without parentheses
JavaScript does not allow nullish coalescing to be combined directly with logical OR or AND without explicit grouping.
JavaScript
JavaScript does not allow nullish coalescing to be combined directly with logical OR or AND without explicit grouping.
Observed message
SyntaxError: cannot use ?? unparenthesized within || and && expressions
Why it happens
How to fix it
Official reference
MDN: SyntaxError: cannot use ?? unparenthesized within || and && expressionsRelated errors
Explore more