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