const myarr = [10, 23, 32, 65, 7, 24];
const sum_of_array = myarr.reduce((a, b) => a + b);
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool
We are getting sum of myarr variable in the code snippet which contains 6 integer values. We are using .reduce() array method and adding its parameters.
Below is a working demo of getting sum of array values.