let val = '1234567890' let isnum = /^d+$/.test(val); if (isnum) { // val is a number }
function hasNumber(myString) { return /d/.test(myString); }