-
Notifications
You must be signed in to change notification settings - Fork 104
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
ObjectsLab #105
base: master
Are you sure you want to change the base?
ObjectsLab #105
Conversation
const appleCount = () => {}; | ||
|
||
const appleCount = (appleCountByName, name) => { | ||
if(!appleCountByName[name]){ |
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.
can we do:
return appleCountByName[name] || 0
How does this work?
const adamAndEveApples = () => {}; | ||
// let names = {"Adam": 2, "Eve": 5} | ||
const adamAndEveApples = (appleCountByName) => { | ||
let sum = 0 |
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.
We don't need this sum variable. Too much work and not helping us. Just return appleCountByName.Adam + appleCountByName.Eve
const appleSum = () => {}; | ||
const appleSum = (appleCountByName, number) => { | ||
let sum = 0 | ||
sum = appleCountByName |
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.
appleCountByName is an object. Make sure you think about things in terms of types of data.
Incomplete as I did what I could with help of Obi