
上QQ阅读APP看书,第一时间看更新
Checking many conditions in an if statement
Sometimes, you will want your if statements to check many conditions before any code block is executed. This is very easy to do. There are two more logical operators that you can use:
- AND: This is used by putting && between the conditions being checked. The code inside the curly brackets is executed only if all the conditions are true:

- OR: This is used by putting || between the conditions being checked. Then, the code inside the curly brackets is executed if any of the conditions are true:
