Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0f0b7be

Browse files
committed
Merge branch 'planningClass12' of github.com:mkruijt/JavaScript into planningClass12
remove reduce
2 parents 1cfb702 + 9b8ab7e commit 0f0b7be

File tree

1 file changed

+49
-3
lines changed

1 file changed

+49
-3
lines changed

Week5/MAKEME.md

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,57 @@ Go trough the reading material in the [README.md](/Week5/README.md) to prepare f
119119
```
120120
How to hand in your homework:
121121
• Clone your existing "hyf-javascript2" Github repository.
122-
• Create a new folder "week2" USING THE COMMAND LINE
123-
• Save your homework files inside this folder.
124-
• When you are done with your homework use add/commit and push to upload your homework.
122+
• Create a new folder "week2" USING THE COMMAND LINE
123+
• Save your homework files inside this folder.
124+
• When you are done with your homework use add/commit and push to upload your homework.
125125
• Write a description for your “commit”.
126126
• Your hyf-javascript2/week2 should now contain all your homework files.
127127
Place the link to your repository folder in Trello.
128128
```
129129

130+
<!--
131+
let wage = tasks
132+
.map((task) => {
133+
return {
134+
name: task.name,
135+
duration: task.duration / 60
136+
}
137+
})
138+
.filter((task) => task.duration >= 2)
139+
.reduce((wage, task) => {
140+
return wage + task.duration * 50
141+
}, 0);
142+
143+
console.log(`Maartje has earned € ${wage.toFixed(2)}`);
144+
145+
let wage2 = 0;
146+
tasks
147+
.map((task) => {
148+
return {
149+
name: task.name,
150+
duration: task.duration / 60
151+
}
152+
})
153+
.filter((task) => task.duration >= 2)
154+
.forEach((task) => {
155+
wage2 += task.duration * 50
156+
}, 0);
157+
158+
console.log(`Maartje has earned € ${wage2.toFixed(2)}`);
159+
160+
let longTasks = tasks
161+
.map((task) => {
162+
return {
163+
name: task.name,
164+
duration: task.duration / 60
165+
}
166+
})
167+
.filter((task) => task.duration >= 2);
168+
169+
let wage3 = 0;
170+
for (let task of longTasks) {
171+
wage3 += task.duration * 50
172+
}
173+
174+
console.log(`Maartje has earned € ${wage3.toFixed(2)}`);
175+
-->

0 commit comments

Comments
 (0)