🔀switch

JSstatementcontrol flowbranch ⟩ switch

(statement)

switch (<expr>) {
    case <value1> : <statements>
    case <value2> : <statements>
    default       : <statements>
}

labeled statement is needed when you want to break out of a statement that is not the nearest enclosing loop / switch.

Last updated

Was this helpful?