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

Skip to content

Conversation

chichiglacierz
Copy link

No description provided.

Copy link

@grod220 grod220 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try not to commit .DS_Store. You may want to add this to your .gitignore file.

Some things are missing:
step2-3.js
step2-4.js
step2-5.js
step2-7.js
step3.js

const salaryPerDay = timeInHours.map(hoursPerDay => hoursPerDay * hourlyRate);
const totalSalary = salaryPerDay.reduce((sum, dailySalary) => sum + dailySalary, 0);
const euroSalary = totalSalary.toFixed(2);
return euroSalary;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and clear code 👍

if (i % 3 === 0) {
threeCallback[i];
} else if (i % 5 === 0) {
fiveCallback[i];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite there. You need to call the function. So instead of
fiveCallback[i];
You'd do
fiveCallback(i)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix

console.log(addSix(10)); // returns 16
console.log(addSix(21)); // returns 27

// Do not change or remove anything below this line
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Above, you'll need to add code to make createBase function work

function makeUnique(arr) {
// Replace this comment and the next line with your code
console.log(arr);
arr = new Set(arr);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice technique using Set data structure 👍


// In the second function, the value of y is an object containing a key and a value.
// when the object is passed in the function, one is added to the value of the object itself
// and the value of the value increases by 1 and we get {x: 10}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you get it (?). Another example:

let a = 4
let b = a
a += 1
What's the value of b?

vs objects...

let a = { name: 'gabe' }
b = a
a.country = 'us'
what's the value of b?

Do you see the difference?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants