check if numeric in typescript code example
Example: typescript check if string is number
let numberToCheck: string = "40";
if(!isNaN(Number(numberToCheck))) {
console.log("string is a number")
}
else {
console.log("string is NOT a number")
}
let numberToCheck: string = "40";
if(!isNaN(Number(numberToCheck))) {
console.log("string is a number")
}
else {
console.log("string is NOT a number")
}