JSFiddle - React, Tailwind, and code Playground
JavaScript
var isANumber = (string) => {
return Number.isNaN(+string)
? console.log(`${string} is not a number`)
: console.log(`${string} is a number`)
};
// place your string here, the function will evaluate if it's a number or not
isANumber('Hello World')