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 = ; const array = 1223;;//=> 2 ;//=> [2] const secondArray = 11223;;//=> 2 ;//=> [1, 2]