Finding Max or Min in Array in Javascript

Comments

You can’t pass an array to Math.max in Javascript.

You can’t pass an array directly to Math.max in Javascript - instead do:

This doesn’t extend to multi-dimensional arrays though. For a two dimensional array I use:

Comments