121. Control flow

변지영·2021년 12월 8일
0

JAVASCRIPT CONDITIONALS


if

else


else if

if (name === "Billy"){
    alert("hi Billy");
} else if ( name === "Susy"){
    alert("hi Susy");
} else{
    alert("I don't know you");
}

JAVASCRIPT LOGICAL OPERATORS


||

if (name === "Billy" || name === "Ann"){
    alert("Hi Billy or Ann!");
}

&&


Nothing happened.
This code doesn't make sense.


We should define firstName and lastName.

!

if(!(name === "Bob")){
    alert("Hi Bob");
}

!(name === "Bob") means name isn't Bob.

0개의 댓글