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

Using the NOT operator to change the condition

Here's a little curveball to wrap your mind around: the NOT logical operator. It's written in code using an exclamation mark. This makes a true condition false, or a false condition true. Let's add a NOT operator to our statement. Line 10 should now look like this:

if ( ! willItBeRainingToday ) { 

Press Play in the editor. You will notice that the decision?1;making is now working the opposite way. Line 11 will be executed only if the willItBeRaining variable is false.

主站蜘蛛池模板: 海南省| 建水县| 宁南县| 始兴县| 丹巴县| 泽普县| 丁青县| 平遥县| 安平县| 泽库县| 石嘴山市| 崇明县| 车致| 余姚市| 保山市| 顺昌县| 黄大仙区| 习水县| 台北市| 浦江县| 临桂县| 无极县| 大邑县| 松江区| 陆河县| 会同县| 仪陇县| 成安县| 潼南县| 东莞市| 阿瓦提县| 台北市| 昭苏县| 陇南市| 新蔡县| 宁明县| 苍梧县| 岳池县| 广昌县| 濮阳县| 龙泉市|