diff --git a/.eslintrc.json b/.eslintrc.json index 0f5eaafc0..e1cb8994c 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -19,6 +19,7 @@ "prefer-arrow-callback": "off", "prefer-destructuring": "off", "prefer-template": "off", - "trailing-comma": "off" + "trailing-comma": "off", + "linebreak-style": "off" } } diff --git a/.gitignore b/.gitignore index 6c589c2f8..e5a9dae46 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,4 @@ typings/ .netlify dist/ +live/ diff --git a/Week1/homework/style.css b/Week1/homework/style.css index bab13ec23..e69de29bb 100644 --- a/Week1/homework/style.css +++ b/Week1/homework/style.css @@ -1 +0,0 @@ -/* add your styling here */ \ No newline at end of file diff --git a/Week2/homework/maartjes-work.js b/Week2/homework/maartjes-work.js index fc8c0e633..fb50659ca 100644 --- a/Week2/homework/maartjes-work.js +++ b/Week2/homework/maartjes-work.js @@ -46,8 +46,12 @@ const maartjesTasks = monday.concat(tuesday); const maartjesHourlyRate = 20; function computeEarnings(tasks, hourlyRate) { - // Replace this comment and the next line with your code - console.log(tasks, hourlyRate); + const totalEarnings = tasks + .map(task => task.duration / 60) + .filter(hours => hours >= 2) + .map(hours => hours * hourlyRate) + .reduce((acc, curVal) => Math.round((acc + curVal) * 100) / 100); + return totalEarnings; } // eslint-disable-next-line no-unused-vars @@ -55,7 +59,8 @@ const earnings = computeEarnings(maartjesTasks, maartjesHourlyRate); // add code to convert `earnings` to a string rounded to two decimals (euro cents) -console.log(`Maartje has earned €${'replace this string with the earnings rounded to euro cents'}`); +// console.log(`Maartje has earned €${'replace this string with the earnings rounded to euro cents'}`); +console.log(`Maartje has earned € ${earnings}`); // Do not change or remove anything below this line module.exports = { diff --git a/Week2/homework/map-filter.js b/Week2/homework/map-filter.js index ab3c622d4..25af8f560 100644 --- a/Week2/homework/map-filter.js +++ b/Week2/homework/map-filter.js @@ -1,8 +1,7 @@ 'use strict'; function doubleOddNumbers(numbers) { - // Replace this comment and the next line with your code - console.log(numbers); + return numbers.filter(num => num % 2 !== 0).map(num => num * 2); } const myNumbers = [1, 2, 3, 4];