1, js in the | | Symbol:
Method of Operation:
As long as "| |" False in front, regardless of "| |" Followed by true or FALSE, return "| |" The value that follows.
As long as "| |" Preceded by true, regardless of "| |" Followed by true or FALSE, return "| |" The preceding value.
Summary: After the true pre-leave
2, JS in the && symbol:
Method of Operation:
As long as "&&" is preceded by false, whether "&&" is followed by true or false, the result will be returned to the value preceding "&&";
As long as "&&" is preceded by true, whether "&&" is followed by true or false, the result will be returned to the value after "&&";
Summary: Fake before really after
Understand the above said should also know:
JS 6 eggs: In the JS logic operation, 0, "", null, False, undefined, Nan will be sentenced to false, the other is true.
Give me a chestnut:
3, bitwise operators: |
Method of Operation:
Two bits as long as there is a 1, then the result is 1. Otherwise, it would be 0.
Continue to raise chestnuts
| Operators can also perform rounding operations
4, bitwise operator:&
Method of Operation:
The number of two digits is the same as, at the same time, 1 is 1, as long as a 0 is 0.
or raise chestnuts:
logical operators in JS &&, | |, bitwise OPERATORS |,&