Answers for "js filter issue stackoverflow"

0

js filter issue stackoverflow

a = [5, 4, 3, 2, 1];
smallvalues = a.filter(function(x) { return x < 3 });   // [2, 1]
everyother = a.filter(function(x,i) { return i%2==0 }); // [5, 3, 1]
Posted by: Guest on June-25-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language