var arr = [1, 'endof', 'trial', 5, 1, 3, 'call', 7] ; var res = filter(arr, function(a) {return a >= 3 && a <= 5 ;}) ; alert (res) ;