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

WM4 - Kerim Zamir - JS Core 2 - Week 1#74

Open
Arbeits-Sachen wants to merge 12 commits into
CodeYourFuture:mainfrom
Arbeits-Sachen:main
Open

WM4 - Kerim Zamir - JS Core 2 - Week 1#74
Arbeits-Sachen wants to merge 12 commits into
CodeYourFuture:mainfrom
Arbeits-Sachen:main

Conversation

@Arbeits-Sachen
Copy link
Copy Markdown

@Arbeits-Sachen Arbeits-Sachen commented Sep 12, 2022

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: Kerim Zamir
  • Your City: Birmingham
  • Your Slack Name: Kerim Zamir

Homework Details

  • Module: JS Core 2
  • Week: 1

Notes

  • What did you find easy?

  • What did you find hard?

  • What do you still not understand?

  • Any other notes?


let myCountry = "UnitedKingdom";
let myCapitalCity; // complete the code
let myCapitalCity = capitalCities.UnitedKingdom; // complete the code
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 question is asking you to use bracket notation, the solution here is

capitalCities[myCountry]

*/

// write code here
student[attendance = 90];
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
student[attendance = 90];
student['attendance'] = 90;

Comment thread 2-mandatory/1-recipes.js
Comment on lines +59 to +87
console.log(recipes.recipe_1.title);
console.log("Servings: " + recipes.recipe_1.servings);
console.log("Ingredients:");
for (let i = 0; i < recipes.recipe_1.ingredients.length; i++)
{
console.log(recipes.recipe_1.ingredients[i]);
}

console.log(recipes.recipe_2.title);
console.log("Servings: " + recipes.recipe_2.servings);
console.log("Ingredients:");
for (let i = 0; i < recipes.recipe_2.ingredients.length; i++)
{
console.log(recipes.recipe_2.ingredients[i]);
}

console.log(recipes.recipe_3.title);
console.log("Servings: " + recipes.recipe_3.servings);
console.log("Ingredients:");
for (let i = 0; i < recipes.recipe_3.ingredients.length; i++)
{
console.log(recipes.recipe_3.ingredients[i]);
}

console.log(recipes.recipe_4.title);
console.log("Servings: " + recipes.recipe_4.servings);
console.log("Ingredients:");
for (let i = 0; i < recipes.recipe_4.ingredients.length; i++)
{
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Whoa!! All this duplication! Is there a better way?

Comment on lines +19 to +23
function createLookup(countryCurrencyCodes)
{
let allCurrencies = {};
countryCurrencyCodes.forEach(ccc => {allCurrencies[ccc[0]] = ccc[1];});
return allCurrencies;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

very good

Comment on lines 19 to +23
};

function createShoppingList(recipe) {
// write code here
function createShoppingList(recipe)
{
shopList = {};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

let or const

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