-
Notifications
You must be signed in to change notification settings - Fork 328
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You did a good job, the code works well and is well formatted. I have some comments though, please see below. Best of luck!
]; | ||
|
||
const tasks = monday.concat(tuesday); | ||
const tasks = monday.concat(tuesday) | ||
let minutesToHours = tasks.filter(a => a.duration >= 120).map(h => h.duration / 60); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mixed up the order of first 2 steps here. While that does not matter much in this case, you should read the instructions carefully.
// Add your code here | ||
console.log(minutesToHours); | ||
|
||
let perHour = minutesToHours.map(v => v * 23) // per hour 23 euro |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should always have meaningful names for the variables, 'v' is not an intuitive name.
|
||
console.log(perHour); | ||
|
||
let total = perHour.reduce(function(a, b) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should have used '=>' function here instead of 'function()', that's what the assignment mentioned.
@@ -2,4 +2,7 @@ | |||
|
|||
const numbers = [1, 2, 3, 4]; | |||
|
|||
// Add your code here | |||
|
|||
const newNumbers = numbers.filter(w => w % 2 !== 0).map(x => x * 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another example of non-intuitive naming :)
No description provided.