Array.prototype.max >= 0.4.1

Purpose

Get the highest value inside the array

Syntax

Array#max ( Stringpath );

Parameters

path

Return values

Examples

Return the highest value in the array

var arr = [0, 1, 2, 3, -1, 60, 20];

arr.max();
>>> 60

Return the highest value in the array, look by path

var arr = [
	{a:  1},
	{a: 50},
	{a:  3},
	{a: 99},
	{a: 51}
];

arr.max('a');
>>> {a: 99}

Comments