@writetome51/get-max-min
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

getMax(numbers): number

Returns max value in numbers

getMin(numbers): number

Returns min value in numbers

The items in numbers can be of type 'number' or 'string'.
For string numbers, the only non-numeric characters allowed are a period, plus,
and minus.

Examples

getMin([1, 10, 2]);
    // --> 1

getMin(['-1.05555', '+1.055']);
    // --> -1.05555

getMin(['-1.05555',  Number.NEGATIVE_INFINITY,  Number.MIN_VALUE]);
    // -->  Number.NEGATIVE_INFINITY

getMax([-1, -10, -2]);
    // --> -1

getMax(['1.05555', '1.055']);
    // -->  1.05555 

getMax(['-1.05555',  Number.POSITIVE_INFINITY,  Number.MAX_VALUE]);
    // -->  Number.POSITIVE_INFINITY

Installation

npm i @writetome51/get-max-min

Loading

import { getMax, getMin } from '@writetome51/get-max-min';

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @writetome51/get-max-min

    Weekly Downloads

    1

    Version

    2.0.1

    License

    FREE

    Unpacked Size

    2.05 kB

    Total Files

    6

    Last publish

    Collaborators

    • writetome51