0.1.2 • Published 6 years ago

array-filterto v0.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

array-filterto

NOTE: array-filterto was renamed to @extra-array/filter. NPM

Filter values from array that pass the test, like Array.filter().

const filterTo = require('array-filterto');
// filterTo(<array>, <test function>, [this], [begin=0], [end], [target=[]], [at])
// - <test function>(<value>, <index>, <array>)

filterTo(['l', 'i', 'v', 'e'], (v) => v>'e');
// ['l', 'i', 'v']
filterTo(['l', 'i', 'v', 'e'], (v, i, arr) => v>'e', null, 1);
// ['i', 'v']
filterTo(['l', 'i', 'v', 'e'], (v, i, arr) => v>'e', null, 1, 3);
// ['i', 'v']
filterTo(['l', 'i', 'v', 'e'], (v, i, arr) => v>'e', null, 1, 3, ['s', 'h']);
// ['s', 'h', 'i', 'v']
filterTo(['l', 'i', 'v', 'e'], (v, i, arr) => v>'e', null, 1, 3, ['s', 'h'], 1);
// ['s', 'i', 'v']
0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago