🔦
Switch(true)
You can use switch (true)
instead of multiple if/else
statements
js
const x = 1switch (true) {case: x === 1 {// ...break}case: 5 < x {// ...break}}
You can use switch (true)
instead of multiple if/else
statements
const x = 1switch (true) {case: x === 1 {// ...break}case: 5 < x {// ...break}}