Skip to content

Commit 48796ef

Browse files
maartjes done
1 parent b71ea8f commit 48796ef

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

Week2/homework/maartjes-work.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,23 @@ const maartjesTasks = monday.concat(tuesday);
4646
const maartjesHourlyRate = 20;
4747

4848
function computeEarnings(tasks, hourlyRate) {
49-
const inHoursArr = tasks.map(hours => task.duration / 60).filter(hours => hours <= 2);
49+
const inHoursArr = tasks.map(task => task.duration / 60).filter(hours => hours <= 2);
5050
const maartjesPayArr = inHoursArr.map(hours => hours * maartjesHourlyRate);
5151
const totalPay = maartjesPayArr.reduce((sum, amount) => sum + amount);
52-
53-
console.log(totalPay);
54-
return totalPay;
55-
56-
52+
const toEuro = totalPay.toFixed(2);
53+
return toEuro;
5754
}
5855

5956
// eslint - disable - next - line no - unused - vars
6057
const earnings = computeEarnings(maartjesTasks, maartjesHourlyRate);
6158

6259
// add code to convert `earnings` to a string rounded to two decimals (euro cents)
6360

64-
//console.log(`Maartje has earned €${'replace this string with the earnings rounded to euro cents'}`);
61+
console.log(`Maartje has earned €${earnings}`);
6562

6663
// Do not change or remove anything below this line
67-
//module.exports = {
68-
// maartjesTasks,
69-
// maartjesHourlyRate,
70-
// computeEarnings,
71-
//};
64+
module.exports = {
65+
maartjesTasks,
66+
maartjesHourlyRate,
67+
computeEarnings,
68+
};

Week2/homework/map-filter.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,9 @@ function doubleOddNumbers(numbers) {
2323

2424
const myNumbers = [1, 2, 3, 4];
2525
console.log(doubleOddNumbers(myNumbers));
26+
27+
// Do not change or remove anything below this line
28+
module.exports = {
29+
myNumbers,
30+
doubleOddNumbers,
31+
};

Week2/homework/wesBrosArray.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
//Array.prototype.filter()
2+
//1. Filter the list of inventors for those who were born in the 1500's

0 commit comments

Comments
 (0)