Skip to content

ObjectsLab#105

Open
dannellmorales wants to merge 1 commit into
joinpursuit:masterfrom
dannellmorales:master
Open

ObjectsLab#105
dannellmorales wants to merge 1 commit into
joinpursuit:masterfrom
dannellmorales:master

Conversation

@dannellmorales

Copy link
Copy Markdown

Incomplete as I did what I could with help of Obi

Comment thread problems/objects.js
const appleCount = () => {};

const appleCount = (appleCountByName, name) => {
if(!appleCountByName[name]){

Copy link
Copy Markdown
Contributor

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?

Comment thread problems/objects.js
const adamAndEveApples = () => {};
// let names = {"Adam": 2, "Eve": 5}
const adamAndEveApples = (appleCountByName) => {
let sum = 0

Copy link
Copy Markdown
Contributor

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

Comment thread problems/objects.js
const appleSum = () => {};
const appleSum = (appleCountByName, number) => {
let sum = 0
sum = appleCountByName

Copy link
Copy Markdown
Contributor

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.

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