Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • JavaScript else if Statements

    • 0
    • 1
    • 0
    • 0
    • 1
    • 0
    • 0
    • 0
    • 117
    Comment on it

    In JavaScript , the correct syntax for elseif is "else if" not "elseif".
    else if statement is used where we have to check multiple statement.

    Example :

    var eating;
    if(eating < 8){
    document.write("Time to take brunch");
    }
    else if(greering < 11){
    document.write(" Time to take lunch");
    else if(eating < 14){
    document.write("Time to take Lunch");
    }
    else
    {
    document.write("Time to take dinner");
    }
    

 1 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: