JS: Get Max/Min Value of Array
Get Maximum Element of Array
Math.max(...xArray)
console.log(Math.max(...[1, 2, 3])); // 3
Get Minimum Element of Array
Math.min(...xArray)
console.log(Math.min(...[1, 2, 3])); // 1
Math.max(...xArray)
console.log(Math.max(...[1, 2, 3])); // 3
Math.min(...xArray)
console.log(Math.min(...[1, 2, 3])); // 1