🔀switch
JS ⟩ statement ⟩ control flow ⟩ branch ⟩ switch
switch (<expr>) {
case <value1> : <statements>
case <value2> : <statements>
default : <statements>
}
not block:
object literal / class / switch ( no block scope❗)
function's scope is different from a block scope❗
Last updated
Was this helpful?