Check if string contains only digits

how about

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

Leave a Comment