Answers for "typescript check if string is number"

1

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")
}
Posted by: Guest on May-20-2021

Code answers related to "typescript check if string is number"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language