How can I easily obtain the min or max element of a JavaScript array?

Example pseudocode:

let array = [100, 0, 50]

array.min() //=> 0
array.max() //=> 100

54 s
54

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *