find-min

1.1.2 • Public • Published

find-min

Build status Coverage Status Downloads

Install

$ npm install find-min

Usage

const findMin = require('find-min');
 
var min = findMin(1, 2, 3, 4)  // 1
 
var min = findMin([1, 2, 3, 4]) //1
 
//Handle array of array
var min = findMin([2, 1, 3, 4, [6, 12], [9, 10], [2], 8]) // 1
 
var min = findMin({1: 2, 2: 4, 4: 5})  //'1'
 
var min = findMin({a: 2, b: 4, c: 5}) //'a'

API

findMin(Arguments)

Arguments would be comma separated value. If you not pass any argument it will return you undefined

findMin(Array)

Type: Array

You can pass single array or array or array. If you pass array of array it will first apply flatten method to produce single array. Then return the minimum value from array.

If you pass empty array it will return undefined.

findMin(Object)

Type: Object

Compare the value of each key and return the minimum value from Object.

Related

Dependencies (0)

    Dev Dependencies (5)

    Package Sidebar

    Install

    npm i find-min

    Weekly Downloads

    13

    Version

    1.1.2

    License

    MIT

    Unpacked Size

    3.98 kB

    Total Files

    4

    Last publish

    Collaborators

    • sandipmo