Query the introduction of JS:
1. Logic or operator |:
When the operator | is a Boolean value, it performs a Boolean OR operation on the two operators.
It calculates the first operation number first. If the value of this expression can be converted to true, it returns the value of the expression on the left. Otherwise, calculate the second operation.
Even if | the operator's number of operations is not a Boolean value, it can be considered a Boolean OR operation, because whatever type of value it returns can be converted to a Boolean value.
On the other hand, we use | for non-Boolean operations, which uses the features that will be returned by non-boolean values. This operation usually selects the first defined and non-null value in a set of optional values (that is, the first value will not be converted to false)
Example:
VaR max = max_width | preferences. max_width || 500