London 9 - Abdulmajid Rammali - JS Core-2 - Week 1#166
Conversation
|
|
||
| for (let player of topPlayers) { | ||
| console.log(player); | ||
| } |
There was a problem hiding this comment.
good job, you can also do it with map/forEach function in one line :
basketballTeam.topPlayers.sort().forEach/map(player => console.log(player))
| if (student.attendance >= 90 && student.examScore > 60) { | ||
| student["hasPassed"] = true; | ||
| } | ||
|
|
There was a problem hiding this comment.
good job, you can add else for false value too :) .
you can use ternary operator as well
| console.log(ingredient); | ||
| } | ||
|
|
||
|
|
There was a problem hiding this comment.
here we wanted you to create 5 receipts and show each key of each receipts in one line , can you think of the solution, if you need help just @ me here, I can send you some tips and the solution :)
| lookup[countryCode] = currencyCode; | ||
| } | ||
| return lookup; | ||
|
|
| }; | ||
|
|
||
| for (let ingredient of recipe.ingredients) { | ||
| if (!pantry.fridgeContents.includes(ingredient) && !pantry.cupboardContents.includes(ingredient)) { |
There was a problem hiding this comment.
well done, you can also use concat to merge two arrays and check once if the value is in there or not , so you can merge the pantry.fridgeContents and pantry.cupboardContents in one array and check includes for that array, does this makes sense? let me know if you need more explanation about this :)
| return balance - MENU.falafel; | ||
| } | ||
| return balance; | ||
| } |
There was a problem hiding this comment.
good job, you can also use ternary operator too :)
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?