js filter issue stackoverflow

Solutions on MaxInterview for js filter issue stackoverflow by the best coders in the world

showing results for - "js filter issue stackoverflow"
Nicolò
04 Mar 2016
1a = [5, 4, 3, 2, 1];
2smallvalues = a.filter(function(x) { return x < 3 });   // [2, 1]
3everyother = a.filter(function(x,i) { return i%2==0 }); // [5, 3, 1] 
4
similar questions
queries leading to this page
js filter issue stackoverflow