How do I find the biggest number in array?

Anyone know how to order an array of numbers? Specifically I want to find the highest number currently present in an array.

I thought …

pc.math.max(this.myArrayOfNumbers);

…might work, but it didn’t :frowning:

Cheers

not sure how pc.math.max is defined, but in vanilla javascrip it would be
Math.max(1, 2, 3, 4). So, having an array, you need to use the spread operator Math.max(...myArray)

1 Like