Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ml-array-mode

mljs63.8kMIT1.1.5TypeScript support: included

Get the most repeated value in an array

readme

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