how about

let isnum = /^\d+$/.test(val);