Math.max()passing array code example
Example: how to return the max and min of an array in javascript
function minMax(arr) {
return [Math.min(...arr), Math.max(...arr)];
}
function minMax(arr) {
return [Math.min(...arr), Math.max(...arr)];
}