|
|
|
|
|
by cevn
2974 days ago
|
|
It's more concise than switch, as well as more powerful (can destructure objects). You can't set things equal to the result of a switch. I find the pattern very convenient. let day;
switch (date) {
case 1:
day = "mon";
break;
case 2:
day = "tues";
break;
default:
day = "wed";
break;
vs let day = match(date) {
1 => 'mon',
2 => 'tues'
}
|
|