Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dd4302c commit a75df88Copy full SHA for a75df88
Week2/homework/maartjes_work.js
@@ -45,3 +45,21 @@ const tuesday = [
45
const tasks = monday.concat(tuesday);
46
47
// Add your code here
48
+
49
+//1. Map the tasks to durations in hours:
50
51
+const taskMapping = tasks.map((i) => i.duration / 60)
52
53
+//2. Filter out everything that took less than two hours:
54
55
+const plusTwoHour = taskMapping.filter((i) => i >= 2)
56
57
+//3. Multiply the each duration by a per-hour rate for billing and sum it all up.
58
59
+let maartjteRate = 9.67;
60
+const maartjteSalary = plusTwoHour.reduce((sum,i) => {return sum + i * maartjteRate}, 0)
61
62
+//4. Output a formatted Euro amount, rounded to Euro cents:
63
64
+let euroFormat = "€" + (maartjteSalary * 10.31).toFixed(2)
65
+console.log(euroFormat);
0 commit comments