Skip to content

Commit e7dc791

Browse files
committed
updated the array methods file
1 parent e01173a commit e7dc791

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

assignments/array-methods.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ console.log(largeShirts);
8484
let ticketPriceTotal = [];
8585
const calc = (acc, donate) =>
8686
{return acc + donate}
87+
runners.forEach(function (object) {
88+
ticketPriceTotal.push(object.donation)})
89+
ticketPriceTotal = ticketPriceTotal.reduce(calc))
8790
console.log(ticketPriceTotal);
8891

8992
// ==== Challenge 5: Be Creative ====

0 commit comments

Comments
 (0)