Skip to content

Completed Week -4-exercises.#58

Open
hackermariama wants to merge 3 commits intorarmatei:masterfrom
hackermariama:week-4
Open

Completed Week -4-exercises.#58
hackermariama wants to merge 3 commits intorarmatei:masterfrom
hackermariama:week-4

Conversation

@hackermariama
Copy link

No description provided.

Copy link

@p-maxwell p-maxwell left a comment

Choose a reason for hiding this comment

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

Occasionally you're untidy with your formatting, but you're precise with your logic. It looks like you're understanding this well. Keep it up.

];

console.log(writers);
console.log(writers.alive);

Choose a reason for hiding this comment

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

This logs undefined, did you mean to do this?

Copy link
Author

Choose a reason for hiding this comment

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

oh yea, i will adjust that

" " +
element.lastName +
" " +
element.lastName +

Choose a reason for hiding this comment

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

Last name is repeated here.

Copy link
Author

Choose a reason for hiding this comment

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

ok will change that

var bottle = {
volume: 0,
fill: function() {
return (this.volume = 100);

Choose a reason for hiding this comment

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

Don't need to return here.

Copy link
Author

Choose a reason for hiding this comment

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

okay do you mean just this.volume=100; should be fine?

Choose a reason for hiding this comment

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

Yes, that's what I mean.

// calling this function should make you bottles volume = 100;
},
drink: function() {
return (this.volume -= 10);

Choose a reason for hiding this comment

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

Or here. Volume -= 10 is enough.

Copy link
Author

Choose a reason for hiding this comment

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

ok noted

// calling this function should decrease your bottles volume by 10;
},
empty: function() {
if (bottle.volume === 0) {

Choose a reason for hiding this comment

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

You do need a return here. :)

Copy link
Author

Choose a reason for hiding this comment

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

i think just need just this.volume=...

Choose a reason for hiding this comment

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

Yes, return this.volume === 0; is a good short way to write it.

} else {
return house1.address;
}
}

Choose a reason for hiding this comment

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

Perfect on this one.

} else {
return "sorry you dont have enough money";
}
}

Choose a reason for hiding this comment

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

Good.

reachableByFerry.transportations.includes("ferry")
)
.map(reachableByFerry => reachableByFerry.destinationName);
//var destinationNameReachableByFerry = travelDestinations

Choose a reason for hiding this comment

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

Best not to leave commented out code around, but the code that isn't commented out is all good.

Copy link
Author

Choose a reason for hiding this comment

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

ok thanks i will take care of that.

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