Menu Home

if

osbo.com | JS | if

if executes when a condition is true.

Syntax

if (condition) {
    code
}

Examples

True

False

Internal

else

else if

switch

try catch

External

Mozilla Developer Network