2.0.0 • Published 5 years ago

modemode v2.0.0

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

modemode

Finds the mode of an array. Defaults to greatest number in event of ties. Optional second parameter, if set to true, will set the function to return array responses, including, if appropriate, an array of the ties.

Install

$ npm i modemode

Usage

const mode = require("modemode");

const array = [1,2,2,3];
mode(array);
//=> 2

mode(array, true);
//=> [2]

const secondArray = [1,1,2,2,3];
mode(secondArray);
//=> 2

mode(secondArray, true);
//=> [1, 2]
2.0.0

5 years ago

1.5.0

5 years ago

1.4.0

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago

0.1.0

5 years ago