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

NW5- EsamA7med-js-core2-wk1-firstPart - #151

Open
esamahmed27 wants to merge 2 commits into
CodeYourFuture:mainfrom
esamaalesaei:main
Open

NW5- EsamA7med-js-core2-wk1-firstPart#151
esamahmed27 wants to merge 2 commits into
CodeYourFuture:mainfrom
esamaalesaei:main

Conversation

@esamahmed27

Copy link
Copy Markdown

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.md in the root of this repository

Your Details

  • Your Name: Esam
  • Your City:Manchester
  • 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?

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();

@KarenPudner KarenPudner Oct 28, 2022

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Correct use of >= and >.

};

console.log(myPet.getName());
//function is not called! No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The function is called but it does not return anything.

Comment thread 2-mandatory/1-recipes.js
for (const ingredient of menu.ingredients) {
console.log(ingredient);
}
}); No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Works well - good use of map()

const newValue = something[1];
newObject[newKey] = newValue;
}
return newObject;

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 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];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good use of spread operator.

return false;
}
return true;
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good use of filter. You could just return !allIngredients.includes(ingredient).

return balance;
}
},
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good, this works well and all the tests pass.

@KarenPudner KarenPudner left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants