Conversation
p-maxwell
left a comment
There was a problem hiding this comment.
Overall very good - looks like you understand everything we've been doing recently.
| @@ -545,7 +545,10 @@ var streetNames = [ | |||
| "Wrestler's Court" | |||
| ]; | |||
|
|
|||
There was a problem hiding this comment.
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.!!!"); |
| var bottle = { | ||
| volume: 0, | ||
| fill: function() { | ||
| return (this.volume = 100); |
There was a problem hiding this comment.
Correct, but you don't need to return a value for this one or drink.
There was a problem hiding this comment.
sorry i cant understand this !
There was a problem hiding this comment.
Functions don't always have to return something. You can update the volume without returning a value.
| // calling this function should decrease your bottles volume by 10; | ||
| }, | ||
| empty: function() { | ||
| if (this.volume === 0) return true; |
There was a problem hiding this comment.
You can make this a little easier with return this.volume === 0.
| */ | ||
| house.currentOwner = newCurrentOwner; | ||
| house.previousOwners[1] = "Stephen B."; | ||
| // house.isForSale= false |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; | ||
| } | ||
| } |
| .filter(destinationmoreThan300AndBytrain) | ||
| .filter(transportByTrain) | ||
| .map(destination => destination.destinationName); | ||
| // Complete here (PRINT THE RESULT IN THE CONSOLE USING FOREACH) |
| return resturant.address.area.includes(area); | ||
| } | ||
| return restaurants.filter(resturantsInArea).length; | ||
| } |
There was a problem hiding this comment.
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.
solved exercises and practise week 4