📅  最后修改于: 2022-03-11 14:48:34.383000             🧑  作者: Mango
let numberToCheck: string = "40";
if(!isNaN(Number(numberToCheck))) {
console.log("string is a number")
}
else {
console.log("string is NOT a number")
}