Skip to content

Commit 02de99c

Browse files
committed
forget the third problem
1 parent 6a6bce9 commit 02de99c

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

‎assignments/array-methods.js‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,23 @@ console.log(company);
116116
// Problem 2 now let's try to just get the company names if their shirt is M
117117
console.log('\n-------- compshirt ---------');
118118
let shirtcomp = runners.filter((shirt) => {
119-
if (shirt.shirt_size === "L") {
119+
if (shirt.shirt_size === "M") {
120120
return runners.company_name;
121121
}
122122
}) ;
123123
console.log(shirtcomp);
124124

125-
// Problem 3
125+
// Problem 3 something random involving a combo let's sum the ids after filtering for now
126+
127+
let ages = runners
128+
//FIRST FILTER FOR SHIRT SIZE
129+
.filter((a) => {
130+
return a.shirt_size === 'M';
131+
console.log(a)
132+
}).map((a) => {
133+
return a.id * 7
134+
}).reduce((sum, a) => {
135+
return sum + a.id;
136+
});
137+
console.log('\n-------- ages ---------');
138+
console.log(ages);

0 commit comments

Comments
 (0)