-
Notifications
You must be signed in to change notification settings - Fork 33
Ivy js2 wk2 #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Ivy js2 wk2 #20
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.
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; |
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.
Nice and clear code 👍
Week3/homework/step2-2.js
Outdated
if (i % 3 === 0) { | ||
threeCallback[i]; | ||
} else if (i % 5 === 0) { | ||
fiveCallback[i]; |
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.
Not quite there. You need to call the function. So instead of
fiveCallback[i];
You'd do
fiveCallback(i)
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.
Please fix
@@ -11,4 +11,6 @@ console.log(addSix(10)); // returns 16 | |||
console.log(addSix(21)); // returns 27 | |||
|
|||
// Do not change or remove anything below this line |
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.
Above, you'll need to add code to make createBase
function work
@@ -4,7 +4,9 @@ const values = ['a', 'b', 'c', 'd', 'a', 'e', 'f', 'c']; | |||
|
|||
function makeUnique(arr) { | |||
// Replace this comment and the next line with your code | |||
console.log(arr); | |||
arr = new Set(arr); |
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.
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} |
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.
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?
No description provided.