array-mode
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
Get the most repeated value in an array.
$ npm install --save ml-array-mode
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
npm i ml-array-mode
7,360
1.1.5
MIT
5.23 kB
8