Core Docs | Additional Modules Docs

Array.prototype.mostCommon


@Description: Finds the most common value in an array. If no value is most common then it returns false.
@File: Array/prototype/mostCommon.js
@Author: Paul Visco
@Version: 1.1 11/19/07
@Return: String/Number/Object Returns the most common value in the array or false if no value is most common.
@Example:
var myArray = [5, 10, 15];
var answer = myArray.mostCommon();
//answer = false;

var myArray = [5, 5, 10, 15];
var answer = myArray.mostCommon();
//answer = 5;