The logical operator "or" (
||) is a way of saying you want to use one value OR another value. As long as one value is truthy, you're happy and will do something with that value.
When evaluating an expression that uses the
Here's a table of when an expression table will result in what value given two comparisons:
truthy || truthy → truthy truthy || falsy → truthy falsy || truthy → truthy falsy || falsy → falsy
For more information on the logical or operator, read this blog post.