max :: Enumerable |
Note: for equivalent elements, the latest one is returned.
Examples
$R(1,10).max() // -> 10
['hello', 'world', 'gizmo'].max() // -> 'world'
function Person(name, age) { this.name = name; this.age = age; }
var john = new Person('John', 20); var mark = new Person('Mark', 35); var daisy = new Person('Daisy', 22);
[john, mark, daisy].max(function(person) { return person.age; }) // -> 35
|
Prototype API 1.5.0 - prototypejs.org