陣列匹配
var result = switch([1, 6]) {
case [2, _]:
"0";
case [_, 6]:
"1";
case []:
"2";
case [_, _, _]:
"3";
case _:
"4";
}
var result = switch([1, 6]) {
case [2, _]:
"0";
case [_, 6]:
"1";
case []:
"2";
case [_, _, _]:
"3";
case _:
"4";
}