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

London10-Afsha-Hossain-JS2-Week1 - #239

Open
Afsha10 wants to merge 3 commits into
CodeYourFuture:mainfrom
Afsha10:main
Open

London10-Afsha-Hossain-JS2-Week1#239
Afsha10 wants to merge 3 commits into
CodeYourFuture:mainfrom
Afsha10:main

Conversation

@Afsha10

@Afsha10 Afsha10 commented Mar 23, 2023

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?

@Afsha10 Afsha10 added the review requested I would like a mentor to review my PR label Mar 23, 2023
Comment thread 2-mandatory/1-recipes.js
*/

let favouriteRecipe1 = {};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This code looks correct to me 👍
One small comment - usually if you're defining an object and you already know the properties and values, it can be easier (to both write and read) to include all the information in your object definition. Using your example, this will look like:

let favouriteRecipe1 = {
    title: "Mole",
    servings: 2,
    ingredients: ["cinnamon", "cumin", "cocoa"]
};

Comment thread 2-mandatory/1-recipes.js
favouriteRecipe1.servings = 2;
favouriteRecipe1.ingredients = ["cinnamon", "cumin", "cocoa"];


Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Seems like we have a lot of duplicate code here to output a recipe in the format that we want.
Can you use a function to reduce the duplication?

];

function createLookup(countryCurrencyCodes) {
return Object.fromEntries(countryCurrencyCodes);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Clever 😄

@@ -19,6 +19,17 @@ let pantry = {
};

function createShoppingList(recipe) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This implementation looks good to me!
For an extra challenge - can you re-write this using the filter array method?

orderBurger: function(balance){
if (balance >= MENU.burger) {
balance = balance - MENU.burger;
} else {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do you think the else clause is needed here? What happens if you remove it?

The rest of the tests have comments describing what to test and you need to
write a matching test
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice job 👍

@@ -55,6 +55,15 @@ function formatCourseworkResult(trainee) {
score: 63
}
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These tests look good to me, but you might need to think about the best way to name your tests.
Imagine you make a change to your code - and a test starts to fail. In the test output, you might see the output has trainee score or the output has trainee name, Aman - but this won't give you any useful information about which part of the code might be broken. Can you think of better names for these tests?

@moneyinthesky

Copy link
Copy Markdown

Good work on this coursework @Afsha10 👍

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

Labels

review requested I would like a mentor to review my PR reviewed A mentor has reviewed this code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants