/*
This method takes a callback that takes two parameters,
one that represents the element from the last iteration and the other is the current
element of the iteration
*/
let nums = [2,4,6,8,3,5]
let result = nums.reduce((prev,curr)=>prev+curr)
console.log(result); // 28