function checkInput(input) { if(input<1) { throw new Error('Hiba! 1-nél kisebb érték!') } let res = input.match(/^[0-9]+$/); return res; }