London 10 | Abubakar-Meigag | JS 2 - wk 1 #251
London 10 | Abubakar-Meigag | JS 2 - wk 1 #251Abubakar-Meigag wants to merge 4 commits intoCodeYourFuture:mainfrom
Conversation
| @@ -22,4 +22,21 @@ | |||
| You should write and log at least 5 recipes | |||
| */ | |||
|
|
|||
| @@ -17,10 +17,36 @@ const COUNTRY_CURRENCY_CODES = [ | |||
| ["MX", "MXN"], | |||
| ]; | |||
|
|
|||
There was a problem hiding this comment.
Looks good to me! I like your use of the forEach array method here.
| for (let ingredient of recipe.ingredients) | ||
| { | ||
|
|
||
| if (pantry.fridgeContents.includes(ingredient)=== false |
There was a problem hiding this comment.
When you have code that looks like this: pantry.fridgeContents.includes(ingredient) === false - you can rewrite it in this way: !pantry.fridgeContents.includes(ingredient). Can you think of why that works?
|
|
||
| function createShoppingList(recipe) { | ||
| // write code here | ||
| } |
There was a problem hiding this comment.
The implementation looks good to me. For an extra challenge - can you implement this using the filter array method?
| @@ -20,9 +20,23 @@ const MENU = { | |||
| }; | |||
|
|
|||
| The rest of the tests have comments describing what to test and you need to | ||
| write a matching test | ||
| */ | ||
|
|
| @@ -89,3 +124,12 @@ function formatCourseworkResult(trainee) { | |||
| subjects: ["HTML", "CSS", "Databases"] | |||
| } | |||
| */ | |||
There was a problem hiding this comment.
These tests look good - but have a think about the best way to name the tests.
Imagine we make a code change which makes this test fail. In the test output - we will see Trainee Aman, score of but this doesn't really tell us which part of the code is broken. Maybe a better name for this is should return error when coursework score is missing (just an example).
|
Nice work on this coursework @Abubakar-Meigag 😄 |
Thanks for you comment and advice I'll start working in all comment thanks again @moneyinthesky |
add foreach for review
Volunteers: Are you marking this coursework? You can find a guide on how to mark this coursework in
HOW_TO_MARK.mdin the root of this repositoryYour Details
Homework Details
Notes
exersies
write test
write test