Let's say I have an Array of numbers: `[2,3,3,4,2,2,5,6,7,2]`

What is the best way to find the minimum or maximum value in that Array?

Right now, to get the maximum, I am looping through the Array, and resetting a variable to the value if it is greater than the existing value:

```
var myArray:Array /* of Number */ = [2,3,3,4,2,2,5,6,7,2];

var maxValue:Number = 0;

for each (var num:Number in myArray)
{
    if (num > maxValue)
        maxValue = num;
}

```

This just doesn't seem like the best performing way to do this (I try to avoid loops whenever possible).