Menu Home

else

osbo.com | JS | else

else executes when a condition is false.

Syntax

if (condition) {
    code
} else {
    code
}

Examples

True

False

Internal

else if

if

switch

try catch

External

Mozilla Developer Network