Highest number variable?

oh this should be sooo easy but i just cant work it out. Check the code:

var myCategory1 = 3;
var myCategory2 = 6;
var myCategory3 = 10;
var myArray = Array(myCategory1, myCategory2, myCategory3);

So as we (all) know Flash will trace the number 10 (highest number in the array), but i need to know what variable 10 came from? eg. did 10 come from myCategory1, myCategory2, myCategory3?


Numbers are primitive types in actionscript. You have to match the value of the variable with the target value using the equality operator.

I think there might be a better way, if you could clarify what exactly do you need to do. Math.max can help.

Btw, did you mean Array.sortOn (Array.Numeric). 16 instead of 18?