We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 48f0402 commit c3f6fadCopy full SHA for c3f6fad
problem50/problem50.js
@@ -35,3 +35,11 @@ for( let i = 0; i < people.length; i++){
35
36
console.log(sumOfAge);
37
38
+/* ================================================
39
+ Final task using for reduce()
40
+===================================================*/
41
+const allAges = people.map(x => x.age);
42
+const ageTotal = allAges.reduce((previoustotal, presentValue) => previoustotal + presentValue,0);
43
+
44
45
+console.log(ageTotal);
0 commit comments