check string for a number javascript 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