Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

find max of countby

var array = [3, 'a', 'a', 'a', 2, 3, 'a', 3, 'a', 2, 4, 9, 3];

var result = _.head(_(array)
  .countBy()
  .entries()
  .maxBy(_.last));

console.log(result);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #max #countby
ADD COMMENT
Topic
Name
2+1 =