🔀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❗
JavaScript: The Definitive Guide ⟩ 5.3.3 switch
Last updated
Was this helpful?