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

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.

主站蜘蛛池模板: 个旧市| 襄垣县| 方城县| 平山县| 湄潭县| 玛沁县| 大宁县| 曲麻莱县| 福鼎市| 牡丹江市| 固原市| 沙湾县| 漳浦县| 桐庐县| 罗平县| 浏阳市| 全椒县| 拉孜县| 高邮市| 绵竹市| 塘沽区| 广南县| 金门县| 颍上县| 柳州市| 左贡县| 乐东| 武威市| 那曲县| 祁阳县| 电白县| 嫩江县| 营口市| 黄大仙区| 玛多县| 齐河县| 宜州市| 谷城县| 永定县| 武功县| 锡林浩特市|