NW5- EsamA7med-js-core2-wk1-firstPart - #151
Conversation
First part completed, next time complete the second part the "2-mandatory"
Mandatory is now completed
| // write code here | ||
|
|
||
| let topPlayers = basketballTeam.topPlayers; | ||
| let alphabeticalOrder = basketballTeam.topPlayers.sort(); |
There was a problem hiding this comment.
Your use of sort() creates the correct result. You also need to use console.log() to output each of these - you could use forEach or something similar.
|
|
||
| // write code here | ||
|
|
||
| if (student.attendance >= 90 && student.examScore > 60) { |
| }; | ||
|
|
||
| console.log(myPet.getName()); | ||
| //function is not called! No newline at end of file |
There was a problem hiding this comment.
The function is called but it does not return anything.
| for (const ingredient of menu.ingredients) { | ||
| console.log(ingredient); | ||
| } | ||
| }); No newline at end of file |
| const newValue = something[1]; | ||
| newObject[newKey] = newValue; | ||
| } | ||
| return newObject; |
There was a problem hiding this comment.
This works well and passes the tests. You could choose some more meaningful variable names to make your code more understandable.
| function createShoppingList(recipe) { | ||
| // write code here | ||
| } | ||
| const allIngredients = [...pantry.fridgeContents, ...pantry.cupboardContents]; |
| return false; | ||
| } | ||
| return true; | ||
| }); |
There was a problem hiding this comment.
Good use of filter. You could just return !allIngredients.includes(ingredient).
| return balance; | ||
| } | ||
| }, | ||
| }; |
There was a problem hiding this comment.
Good, this works well and all the tests pass.
KarenPudner
left a comment
There was a problem hiding this comment.
Good work - this all works well, your tests pass and you have clearly understood the work covered. Check my comments for some minor points, but generally this is very good.
First part completed, next time complete the second part the "2-mandatory"
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
What did you find easy?
What did you find hard?
What do you still not understand?
Any other notes?