There was an error while loading. Please reload this page.
Find smallest and largest values.
Similar: min, minEntry, max, maxEntry, range, rangeEntries.
function range(x, fc, fm) // x: an iterable // fc: compare function (a, b) // fm: map function (v, i, x)
const xiterable = require('extra-iterable'); var x = [1, 2, -3, -4]; xiterable.range(x); // → [-4, 2] xiterable.range(x, (a, b) => Math.abs(a) - Math.abs(b)); // → [1, -4] xiterable.range(x, null, v => Math.abs(v)); // → [1, -4]