Update Solutions_w02d02_morning_exercise

master
Kristyn Bryan 10 years ago
parent e62539511a
commit 9213c75743

@ -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?:

Loading…
Cancel
Save