官术网_书友最值得收藏!

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:
主站蜘蛛池模板: 胶南市| 扎囊县| 丰台区| 东源县| 临清市| 乐东| 上杭县| 泾阳县| 新民市| 桓台县| 巴中市| 朔州市| 宣恩县| 改则县| 乐亭县| 绩溪县| 温泉县| 黄浦区| 德阳市| 洱源县| 保定市| 赞皇县| 平陆县| 东山县| 鄂托克旗| 鹰潭市| 沂南县| 彭泽县| 福安市| 灌南县| 库尔勒市| 介休市| 麻栗坡县| 黔西县| 雷山县| 康马县| 库尔勒市| 大足县| 嵊泗县| 玉山县| 柏乡县|