Skip to content
This repository was archived by the owner on Jan 14, 2024. It is now read-only.

London 9 -Sana Asaf - JavaScript-Core-2-Coursework-Week1#181

Open
SanaAsaf wants to merge 1 commit into
CodeYourFuture:mainfrom
SanaAsaf:main
Open

London 9 -Sana Asaf - JavaScript-Core-2-Coursework-Week1#181
SanaAsaf wants to merge 1 commit into
CodeYourFuture:mainfrom
SanaAsaf:main

Conversation

@SanaAsaf
Copy link
Copy Markdown

Volunteers: Are you marking this coursework? You can find a guide on how to mark this coursework in HOW_TO_MARK.md in the root of this repository

Your Details

  • Your Name:
  • Your City:
  • Your Slack Name:

Homework Details

  • Module:
  • Week:

Notes

  • What did you find easy?

  • What did you find hard?

  • What do you still not understand?

  • Any other notes?


let array=basketballTeam.topPlayers;
console.log(array.sort());
// write code here
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great job, we wanted to see the name of each player so you should do this instead:

basketballTeam.topPlayers.sort().map(eachPlayer =>. console.log(eachPlayer))

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.

Its concise and so neat ! I will try and refactor mine

*/
if (student["examScore"]>60 && student["attendance"]>=90)
student["hasPassed"] = true ;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

good job, you can also add else :

`else{
student["hasPassed"] = false;

}`

Comment thread 2-mandatory/1-recipes.js
}
recipe.displayRecipe();
recipe1.displayRecipe();
recipe2.displayRecipe();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

great job and a great idea, but the question did not want you to have a method inside of each recipe, it is important to do what the questions ask us to do, you should find a way to go through each recipe and console.log the recipe items.
hint: you can have array of objects

shoppingList.items = [];
recipe.ingredients.map(item => {
if (!pantry.fridgeContents.includes(item) && !pantry.cupboardContents.includes(item))
shoppingList.items.push(item);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

great job, you can use concat function from Javascript to combine both arrays and have one array and check the items in that array ==> let allIHave = pantry.fridgeContents.concat(cupBoardContents)

@ellietms ellietms added the reviewed A mentor has reviewed this code label Jan 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

reviewed A mentor has reviewed this code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants