@kingjs/linq.min

    1.0.6 • Public • Published

    @kingjs/linq.max

    Returns the minimum value in a sequence of values projected from elements of a sequence.

    Usage

    Return the minimum value of 1, 2, 3 like this:

    var max = require('@kingjs/linq.max');
    var sequence = require('@kingjs/enumerable.create');
     
    max.call(sequence(1, 2, 3));

    result:

    1

    Return the oldest person like this:

    var max = require('@kingjs/linq.max');
    var sequence = require('@kingjs/enumerable.create');
     
    var compareAge = function(l, r) { return l.age < r.age; }
     
    max.call(sequence(
      { name: 'Alice', age: 18 },
      { name: 'Bob', age: 18 },
      { name: 'Chris', age: 19 },
    ), compareAge);

    result:

    { name: 'Alice', age: 18 }

    API

    declare function min(
      this: Enumerable,
      lessThan?: (l, r) => boolean
    )

    Interfaces

    Parameters

    • this: Sequence to search for max element.
    • lessThan: Optional element comparison function.

    Return Value

    The minimum element.

    Install

    With npm installed, run

    $ npm install @kingjs/linq.min
    

    Acknowledgments

    Like Enumerable.Min.

    License

    MIT

    Analytics

    Keywords

    none

    Install

    npm i @kingjs/linq.min

    DownloadsWeekly Downloads

    9

    Version

    1.0.6

    License

    MIT

    Unpacked Size

    3.59 kB

    Total Files

    4

    Last publish

    Collaborators

    • kingces95