use the little understood array.sort()
Code:
function getMax(p_oArray) {
p_oArray.sort(sortOrder);
return p_oArray[p_oArray.length];
}
function sortOrder(a, b){
return (a - b);
}
var max = getMax(somearray);
(probably needs a "blog" post to explain it  )
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|