Skip to content

Latest commit

 

History

History

if-statements

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

JavaScript - If else block

If else blocks are used for the conditional checkers.

First condition would be placed in if block, statements would be executed if that block is true.

If not, the control would be moved to the else block.

  • if-else ladder.
    if (condition) {
        //statement
    } else if(condition) {
        //statement
    } else if(condition) {
        //statement
    } else {
        //statement
    }