"Finding Maximum/Minimum Value in an Array" Article Question

Today I needed to get the maximum value(s) of an array and was wondering the best method to approach this.

After researching the topic a bit more I was wondering why Kirupa uses a loop to return this value when you can simply use Array.sort and slice out the last (or first if reversed) elements.

For all of you out there looking to do this not only for the max value but the top values (as many as you like until the end of the array) here is a simpler method:

var values = ['2', '4', '4', '1', '3'];
var count = 3;

values.sort( Array.NUMERIC | Array.DESCENDING );
values = values.slice(0, count);
trace('Top ' + count + ' Values: ' + values);

http://www.kirupa.com/developer/actionscript/array_max_min.htm

Julian