Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Week2/homework/maartjes_work.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,11 @@ const tuesday = [
];

const tasks = monday.concat(tuesday);
const salaryPerHour = 10;

// Add your code here
const maartjesEarnings = tasks
.map((tasks) => tasks.duration / 60)
.filter((paidHours) => paidHours >= 2)
.reduce((totalEarnings, paidHour) => totalEarnings + paidHour * salaryPerHour, 0);

console.log('Maartje has earned €' + Math.round(maartjesEarnings, 2) + ' by completing her tasks.');
6 changes: 5 additions & 1 deletion Week2/homework/map_filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@

const numbers = [1, 2, 3, 4];

// Add your code here
const newNumbers = numbers
.filter((number) => number % 2 !== 0)
.map((number) => number * 2);

console.log(newNumbers);