how to ask that a string is a number in javascript code example
Example 1: javascript is variable a string
if (typeof myVar === 'string'){
//I am indeed a string
}
Example 2: js check if string is integer
function isInt(str) {
return !isNaN(str) && Number.isInteger(parseFloat(str));
}