diff --git a/unit_01/w02d02/morning_exercise/Solutions_w02d02_morning_exercise b/unit_01/w02d02/morning_exercise/Solutions_w02d02_morning_exercise index 9c60de9..8df6b6a 100644 --- a/unit_01/w02d02/morning_exercise/Solutions_w02d02_morning_exercise +++ b/unit_01/w02d02/morning_exercise/Solutions_w02d02_morning_exercise @@ -125,8 +125,39 @@ var sheepShearers = [ => 3238 ``` +/////////////////////////// +SOLUTION: sheepShearer +var sheepShearers = [ + { + name: "Tim", + age: 20, + sheepCount: 18 + }, + { + name: "C3PO", + age: 200, + sheepCount: 320 + }, + { + name: "Cousin It", + age: Infinity, + sheepCount: 2900 + } +]; + + +var total = sheepShearers + .map(function(item) { + return item.sheepCount; + }) + .reduce(function(sum, num) { + return sum += num; + }); + +console.log(total); + #### FINISHED EARLY?: