javascript search max min value array code example
Example 1: Find the maximum number of an array js
function getMaxOfArray(numArray) {
return Math.max.apply(null, numArray);
}
Example 2: find max and min value in array javascript
var numbers = [1, 2, 3, 4];
Math.max(...numbers) // 4
Math.min(...numbers) // 1