Home >Web Front-end >HTML Tutorial >js || && detailed explanation
This time I will bring you a detailed explanation of js || &&. What are the precautions when using js || &&. The following is a practical case, let’s take a look.
|| or bit symbol
a || b
1. When a and b are both true, return a
2. When a and b are both false, return b
3. When a and b are one false and one true, return the value of true
&& and the bit symbol
a&&b
1. When a and b are both true, return b
2. When b is false, return a
3. When a, b When one false and one true, the value of return false
I believe you have mastered the method after reading these cases. For more exciting information, please pay attention to php Chinese website Other related articles!
Related reading:
What are the layout schemes for mobile terminals in HTML
What are the techniques for using scroll bars in HTML
How to make the input text box and img verification code
#How to define the minimum height of the inline element span
The above is the detailed content of js || && detailed explanation. For more information, please follow other related articles on the PHP Chinese website!