-
Notifications
You must be signed in to change notification settings - Fork 1
max
Subhajit Sahu edited this page May 9, 2020
·
25 revisions
iterable.max(x, [fn]);
// x: an iterable
// fn: compare function (a, b)
const iterable = require('extra-iterable');
var x = [1, 2, -3, -4];
iterable.max(x);
// 2
iterable.max(x, (a, b) => Math.abs(a) - Math.abs(b));
// -4