-
Notifications
You must be signed in to change notification settings - Fork 0
min
Subhajit Sahu edited this page Dec 28, 2022
·
14 revisions
Find smallest value.
function min(x, fc, fm)
// x: ilists
// fc: compare function (a, b)
// fm: map function (v, k, x)
const xilists = require('extra-ilists');
var x = [['a', 'b', 'c', 'd'], [1, 2, -3, -4]];
xilists.min(x);
// → -4
xilists.min(x, (a, b) => Math.abs(a) - Math.abs(b));
// → 1
xilists.min(x, null, v => Math.abs(v));
// → 1