help
ayormeday (9)

how do i modify the function to return the total summed age of all of the people.

function getSummedAge(people) {

const arrSum = arr => arr.reduce((name,age) => name + age, 0)
}

/ Do not modify code below this line /

const examplePeopleArray = [
{ name: 'John', age: 10 },
{ name: 'Jack', age: 20 },
{ name: 'Jane', age: 25 }
];

console.log(getSummedAge(examplePeopleArray), '<-- should be 55');

You are viewing a single comment. View All
mwilki7 (277)

@heyitsmarcus I always hated functional programming.
F# was a bad time in my life.