In Python and, or; JS in &&, ||

Python

>>> 1 and 2
2
>>> 1 or 2
1

For or tests, Python evaluates the operand objects from left to right and returns the first
one that is true

JS

JS and Python syntax consistent at this point

Guess you like

Origin www.cnblogs.com/atituiset/p/11298578.html