JS: Get Max/Min Value of Array

By Xah Lee. Date: . Last updated: .

Get max:

Math.max(...myArray)

Get min:

Math.min(...myArray)

[see Spread Operator]

[see Math]

BUY ΣJS JavaScript in Depth