-
Notifications
You must be signed in to change notification settings - Fork 1
filter
wolfram77 edited this page Mar 27, 2020
·
27 revisions
Keeps values which pass a test.
array.filter(x, fn, [ths]);
// x: an array
// fn: test function (v, i, x)
// ths: this argument
const array = require('extra-array');
var x = [1, 2, 3, 4, 5];
array.filter(x, v => v % 2 === 0);
// [2, 4]