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

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.

主站蜘蛛池模板: 陆川县| 通化县| 清镇市| 高台县| 麻城市| 巴林左旗| 政和县| 临城县| 崇阳县| 尼勒克县| 临朐县| 民乐县| 汶上县| 黔南| 钟山县| 聂荣县| 姜堰市| 洞口县| 白朗县| 南京市| 墨脱县| 巴青县| 温宿县| 抚宁县| 庆安县| 林口县| 三亚市| 扶沟县| 琼结县| 祥云县| 龙井市| 安吉县| 西城区| 辽源市| 红桥区| 南充市| 石台县| 保德县| 乌海市| 田林县| 大化|