if string is numeric code example Example: check if string can be a number and then make a number if(Number(myNumber) != NaN){ myNumber = Number(myNumber); }