check if string only contains integer digits numbers javascript

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

Also in JavaScript: