Skip to content

Week four#61

Open
youssef910 wants to merge 16 commits intorarmatei:masterfrom
youssef910:WeekFour
Open

Week four#61
youssef910 wants to merge 16 commits intorarmatei:masterfrom
youssef910:WeekFour

Conversation

@youssef910
Copy link
Copy Markdown

solved exercises and practise week 4

Copy link
Copy Markdown

@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.

Overall very good - looks like you understand everything we've been doing recently.

@@ -545,7 +545,10 @@ var streetNames = [
"Wrestler's Court"
];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Try to branch from master for each new week so stuff from the previous week isn't included. Skipping to the week 4 stuff.

);
}
writers.map(message);
console.log(" writers that are alive.!!!");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good, all correct here.

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

Choose a reason for hiding this comment

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

Correct, but you don't need to return a value for this one or drink.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

sorry i cant understand this !

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Functions don't always have to return something. You can update the volume without returning a value.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

ok got it

// calling this function should decrease your bottles volume by 10;
},
empty: function() {
if (this.volume === 0) return true;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You can make this a little easier with return this.volume === 0.

*/
house.currentOwner = newCurrentOwner;
house.previousOwners[1] = "Stephen B.";
// house.isForSale= false
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Try to delete commented out code before committing.

var housesPrices = [house1.price, house2.price];
var theCheapestPrice = Math.min(...housesPrices);
if (house1.price === theCheapestPrice) return house1.address;
if (house2.price === theCheapestPrice) return house2.address;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This does work, but you can do it more simply by comparing house1.price and house2.price directly.

} else {
return "Sorry you don't have enough money for a" + coffee;
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good solution.

.filter(destinationmoreThan300AndBytrain)
.filter(transportByTrain)
.map(destination => destination.destinationName);
// Complete here (PRINT THE RESULT IN THE CONSOLE USING FOREACH)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Very good solution.

return resturant.address.area.includes(area);
}
return restaurants.filter(resturantsInArea).length;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Careful with some of the spelling in the code - you'll find many of your future colleagues will tend to be very precise about things being spelled right - but the logic is again very good, good solution.

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