var = $.grep([1,32,5,63,8,4,-8,-5,2,56,9,62,-6],function (n , i){ if(n>50){ return n; } }); console.log(test);