Nearly Perpendicular Macaroons

    @extra-lists/range
    TypeScript icon, indicating that this package has built-in type declarations

    2.2.10 • Public • Published

    Finds smallest and largest entries. 📦 😺 🏃 📼 🌔 📜 📰 📘

    Similar: min, max, range.

    This is part of package extra-lists.


    lists.range(x, [fc], [fm]);
    // x:  lists
    // fc: compare function (a, b)
    // fm: map function (v, k, x)
    // → [smallest, largest]
    const lists = require('extra-lists');
    
    var x = [['a', 'b', 'c', 'd'], [1, 2, -3, -4]];
    lists.range(x);
    // [ [ 'd', -4 ], [ 'b', 2 ] ]
    
    lists.range(x, (a, b) => Math.abs(a) - Math.abs(b));
    // [ [ 'a', 1 ], [ 'd', -4 ] ]
    
    lists.range(x, null, v => Math.abs(v));
    // [ [ 'a', 1 ], [ 'd', -4 ] ]


    References

    Install

    npm i @extra-lists/range

    DownloadsWeekly Downloads

    1

    Version

    2.2.10

    License

    MIT

    Unpacked Size

    5.56 kB

    Total Files

    7

    Last publish

    Collaborators

    • wolfram77