test=function(arr){ try{arr.forEach(function(el){if(el<1) throw false})}catch(e){return e} return true } alert(test([1,2,3,4,5])) alert(test([1,2,0,4,5])) // true // false