Conditionals

1 min read

Tech


var a = 5;
var b = 10;</p>

if ( a < b ) {
alert(“Yes, a is less than b”);
}

if ( a == b ) {
alert(“Yes, a is equal to b”);
}

We are now going over conditionals in the Lynda.com course. This stuff is relatively easy to comprehend– Boolean statements and conditionals make a great pair.

~~~~
var phrase = (“Benedict Cumberbatch”);
if (phrase.length > 10) {
alert(“That is a long name!”);
}
~~~~
We didn’t go over calculations such as .length but I remembered it from Codecademy sessions I did in the summer.

I really am looking forward to this. Using Alice will be a fun challenge….

CC BY-SA 4.0 Conditionals by Tiffany White is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.