CONDITIONS

Where do I need them?

IF

if (age < 18) {
    console.log("Go home!");
}

ELSE

if (age < 18) {
    console.log("Go home!");
} else {
    console.log("Welcome!");
}

ELSE IF

if (age < 18) {
    console.log("Go home!");
} else if (age < 24) {
    console.log("Welcome to the first floor!");
} else {
    console.log("Welcome to the second floor!");
}

COMPARISON OPERATORS

==equal to
===equal value and equal type
!=not equal
!==not equal value or not equal type
>greater than
<less than
>=greater than or equal to
<=less than or equal to

BOOLEAN VARIABLES

Where do we need them?

var isAnAdult = (age >= 18);
var isReady = true;
var hasPaid = false;

LOGICAL OPERATORS

&&AND
||OR
!NOT

ADVANCED

If the customer is an employee or a child without celiac, who's age is between 3 and 5, we will serve meatballs.

if ( isAnEmployee || (!hasCeliac && age >= 3 && age <= 5) ) {
    console.log("We will serve you meatballs!");
}

HOW TO DEBUG CONDITIONAL CODE ON A WEB PAGE

Lets see...