js check string for number code example
Example 1: javascript is variable a string
if (typeof myVar === 'string'){
//I am indeed a string
}
Example 2: js string have number js
var hasNumber = /\d/;
hasNumber.test("ABC33SDF"); //true
hasNumber.test("ABCSDF"); //false
Example 3: how to check if a string is an integer javascript
isNaN(num) // returns true if the variable does NOT contain a valid number