JavaScript Rules :: Fast min/max

Choose the array size and click Run button. An array of random integer numbers ranging from 0 to [array size] will be generated. To get the largest number within the array, the first attempt is using a for loop, then an optimized version of this same algorithm and last but not least using Math.max.

Array size:

Array creation:0ms
For loop:0ms
Optmized for:0ms
Math.max:0ms

Read the full post.