// find maximum value of array in javascript
// array reduce method
const arr = [49,2,71,5,38,96];
const max = arr.reduce((a, b) => Math.max(a, b));
console.log(max); // 96
// math.max apply method
const max_ = Math.max.apply(null, arr);
console.log(max_); // 96
// or math.max spread operator method
const max__ = Math.max(...arr);
console.log(max__); // 96