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

London9 - Lovelace - Bahare Bahreinian - JavaScript-Core 2 - Week 1 - #160

Open
Bahare09 wants to merge 4 commits into
CodeYourFuture:mainfrom
Bahare09:main
Open

London9 - Lovelace - Bahare Bahreinian - JavaScript-Core 2 - Week 1 #160
Bahare09 wants to merge 4 commits into
CodeYourFuture:mainfrom
Bahare09:main

Conversation

@Bahare09

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?

// write code here

basketballTeam.topPlayers.sort().forEach((item) => console.log(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.

good job :)

if ((student["attendance"] = 90 && student["examScore"] > 60)) {
student["hasPassed"] = true;
} else student["hasPassed"] = false;

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.

well done, also you can use ternary operator

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.

done:)

Comment thread 2-mandatory/1-recipes.js
console.log("Serves: " + favoriteRecipe[i].servings);
console.log("Ingredients:");
favoriteRecipe[i].ingredients.forEach((item) => console.log(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.

nice :) , you can use favorite recipe.length in your for loop, what if someone adds a recipe to your array?

let missItems = recipe.ingredients.filter(
(item) =>
pantry.fridgeContents.indexOf(item) === -1 &&
pantry.cupboardContents.indexOf(item) === -1

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.

you can merge these 2 arrays together and just check that array (array which includes all items in pantry.fridgeCiontent and pantry.cupboardContent)


function createLookup(countryCurrencyCodes) {
// write code here
return Object.assign(...COUNTRY_CURRENCY_CODES.map((d) => ({ [d[0]]: d[1] }))

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.

instead of using d (as a variable name) , always use a variable name with meaningful name

@ellietms ellietms added the reviewed A mentor has reviewed this code label Dec 30, 2022
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