-
Notifications
You must be signed in to change notification settings - Fork 1
range
wolfram77 edited this page Apr 1, 2020
·
27 revisions
Finds smallest and largest values.
iterable.range(x, [fn]);
// x: an iterable
// fn: compare function (a, b)
// --> [min, max]
const iterable = require('extra-iterable');
var x = [1, 2, -3, -4];
iterable.range(x);
// [-4, 2]
iterable.range(x, (a, b) => Math.abs(a) - Math.abs(b));
// [1, -4]