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

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:
主站蜘蛛池模板: 镇坪县| 共和县| 儋州市| 沭阳县| 维西| 青冈县| 韶关市| 科尔| 瓦房店市| 张掖市| 呼和浩特市| 庆阳市| 石家庄市| 宁陵县| 丹寨县| 辽阳县| 台州市| 咸宁市| 海丰县| 自贡市| 遵义市| 海兴县| 康保县| 搜索| 武清区| 元氏县| 广平县| 吐鲁番市| 彭水| 商城县| 岳西县| 兰西县| 聂荣县| 南溪县| 舞钢市| 苏尼特左旗| 乌兰察布市| 澳门| 嘉义县| 株洲县| 汪清县|