Skip to content

Files

Latest commit

4b31b43 · Jan 23, 2023

History

History

if-statements

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jan 23, 2023
Jan 23, 2023

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
    }