tsswitch (a) {
case 0:
console.log("o"); // break/returnがないのでerror
case 1: // これはせーふ
case 2:
console.log("1,2");
break;
}
tsfunction hoge(color: "blue" | "black"): string {
if (color === "blue") {
return "beats";
} else {
"bose"; // returnしてないのでerror
}
}
string
)を明示してないとエラーにならない