Skip to content

Latest commit

 

History

History

array-mode

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

array-mode

NPM version npm download

Get the most repeated value in an array.

Installation

$ npm install --save ml-array-mode

Usage

import mode from 'ml-array-mode';

const result = mode([1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4]);
// 4

License

MIT