JavaScript OR (||) variable assignment explanation

See short-circuit evaluation for the explanation. It’s a common way of implementing these operators; it is not unique to JavaScript.

Leave a Comment