Javascript logical operatorscan be used in non-Boolean environments.
Although the && and || operators can be used in non-Boolean environments, if their return values can be converted to Boolean values, they can also be considered Boolean operations
(from logical operator)
For non-Boolean environments:
When there is one false, return the value on the false side When there are two false, return the value before the operator (left side); When there are two true, return the value after the operator (right side) value.
(derived from the return value of logical operations in JavaScript (logical AND &&, logical OR ||, logical NOT!))
First of all, you need to know the false values in js: 0, false, '', null, undefined, NaN In combination or operation When one.nextElementSibing is not any of the above values, next = one.nextElementSibing; otherwise it is equal to one. nextSibing
Javascript logical operatorscan be used in non-Boolean environments.
(from logical operator)
For non-Boolean environments:
(derived from the return value of logical operations in JavaScript (logical AND &&, logical OR ||, logical NOT!))
First of all, you need to know the false values in js: 0, false, '', null, undefined, NaN
In combination or operation
When one.nextElementSibing is not any of the above values, next = one.nextElementSibing; otherwise it is equal to one. nextSibing