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

WM4-MICHEALE-ANDEMARIAM-JAVASCRIPT-CORE-2-COURSEWORK-WEEK1#104

Open
micheale2021 wants to merge 10 commits into
CodeYourFuture:mainfrom
micheale2021:main
Open

WM4-MICHEALE-ANDEMARIAM-JAVASCRIPT-CORE-2-COURSEWORK-WEEK1#104
micheale2021 wants to merge 10 commits into
CodeYourFuture:mainfrom
micheale2021:main

Conversation

@micheale2021
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: MICHEALE ANDEMARIAM
  • Your City: WM
  • Your Slack Name: MICHEALE ANDEMARIAM

Homework Details

  • Module: JAVASCRIPT-CORE-2
  • Week: 1

Notes

  • What did you find easy?

    • Accessing values
  • What did you find hard?

  • What do you still not understand?

    • Object methods
  • Any other notes?

Comment thread 2-mandatory/1-recipes.js

console.log(favoriteRecipes.Title);
console.log(`Serves: ${favoriteRecipes.Serves}`);
console.log(`Ingredients: ${favoriteRecipes.Ingredients}`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
console.log(`Ingredients: ${favoriteRecipes.Ingredients}`);
console.log(`Ingredients: ${favoriteRecipes.Ingredients.split('\n')}`);

Comment on lines +22 to +29
let missingItems = recipe.ingredients.filter((item)=> {

return !pantry.fridgeContents.includes(item) && !pantry.cupboardContents.includes(item)

});
return {
name : recipe.name,
items : missingItems,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
let missingItems = recipe.ingredients.filter((item)=> {
return !pantry.fridgeContents.includes(item) && !pantry.cupboardContents.includes(item)
});
return {
name : recipe.name,
items : missingItems,
let missingItems = recipe.ingredients.filter((item)=> {
const isInFridge = pantry.fridgeContents.includes(item)
const isInCupboard = pantry.cupboardContents.includes(item)
return !isInFridge && !isInCupboard
});
return {
name : recipe.name,
items : missingItems,

// write code here
orderBurger: function(balance){
if(balance >= MENU.burger){
return MENU.burger - 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.

Suggested change
return MENU.burger - balance
return balance - MENU.burger

},
orderFalafel: function(balance){
if(balance >= MENU.falafel){
return MENU.falafel - 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.

Suggested change
return MENU.falafel - balance
return balance - MENU.falafel

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.

2 participants