Chrome Extension

Find the maximum value from an array using Javascript

The code can be helpful to get the maximum value from an array using Javascript. We are using .reduce() method of array to find the maximum value from array.
const myarr = [10, 23, 32, 65, 7, 24];
const max_value = myarr.reduce((a, b) => a > b ? a : b);
console.log(max_value);
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool

Example Demo

Was this helpful?
0 Comments
Join Devsheet Ask a Question