@extra-array/max-on
TypeScript icon, indicating that this package has built-in type declarations

2.7.8 • Public • Published

Finds largest value. 🏃 📼 📦 🌔

Alternatives: compare, map.
This is part of package extra-array.

array.maxOn(x, [fn], [ths]);
// x:   an array
// fn:  map function (v, i, x)
// ths: this argument
const array = require('extra-array');

var x = [1, 2, -3, -4];
array.maxOn(x);
// 2

array.maxOn(x, v => Math.abs(v));
// -4

references

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @extra-array/max-on

      Weekly Downloads

      11

      Version

      2.7.8

      License

      MIT

      Unpacked Size

      6.63 kB

      Total Files

      19

      Last publish

      Collaborators

      • wolfram77