Home  >  Article  >  Web Front-end  >  js || && detailed explanation

js || && detailed explanation

php中世界最好的语言
php中世界最好的语言Original
2018-02-24 09:49:141644browse

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

Commonly used input text box content is automatically vertically centered and defaults The prompt text is empty when clicked

#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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn