Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

add reduce map filter #72

Closed
wants to merge 1 commit into from
Closed

Conversation

WardMad
Copy link

@WardMad WardMad commented Jul 29, 2018

No description provided.

Copy link

@harditsingh harditsingh left a 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);

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

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) {

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);

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 :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants