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

London10 - Eagles - Kristina Dudnyk - JavaScript-2 - Week-1#245

Open
KristinaDudnyk wants to merge 2 commits intoCodeYourFuture:mainfrom
KristinaDudnyk:main
Open

London10 - Eagles - Kristina Dudnyk - JavaScript-2 - Week-1#245
KristinaDudnyk wants to merge 2 commits intoCodeYourFuture:mainfrom
KristinaDudnyk:main

Conversation

@KristinaDudnyk
Copy link

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: Kristina Dudnyk
  • Your City:London
  • Your Slack Name: KristinaDudnyk

Homework Details

  • Module: js2
  • Week:1

Notes

  • What did you find easy?

  • What did you find hard?

  • What do you still not understand?

  • Any other notes?

capitalCities.Peru.name = "Lima";
capitalCities.Peru.population = 9750000;
console.log(capitalCities);

Choose a reason for hiding this comment

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

instead of adding an empty variable and then adding values to it you can add the new country and its properties in one statement
capitalCities.peru = { name: "Lima", population: 9750000 };

Copy link
Author

Choose a reason for hiding this comment

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

Thanks


// write code here
if(student.examScore > 60 && student.attendence >= 90){
student.hasPassed = true
Copy link

@mira-shukla mira-shukla Apr 14, 2023

Choose a reason for hiding this comment

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

here bracket notation is meant to be used instead of the . notation

console.log(TheRecipeCard.title)
console.log(`Serves: ${TheRecipeCard.Serves}`)
console.log(TheRecipeCard.Ingredients.forEach(property => {console.log(property)}))
//why do I have underfind for 5th element wich doesn't exist ? :< No newline at end of file

Choose a reason for hiding this comment

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

The reason you're getting undefined is that the forEach method doesn't return a value. It simply iterates over each element of the array and performs an operation on it, but it doesn't return anything. for example: TheRecipeCard.Ingredients.forEach(property => { console.log(property);


function createLookup(countryCurrencyCodes) {
// write code here
return Object.fromEntries(countryCurrencyCodes);

Choose a reason for hiding this comment

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

Here you're not quite looking up for each country and currency


let cashRegister = {
// write code here
orderBurger (balance){

Choose a reason for hiding this comment

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

here the balance is actually the remaining balance so at some point we would not have any remaining balance left

function countWords(string) {
const wordCount = {};
const words = string.split(" ")

Choose a reason for hiding this comment

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

this looks really good but you could also check if the string is empty before beginning?

Choose a reason for hiding this comment

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

you're also only splitting using spaces, what if there was a comma or any other punctuation in the string would it still work?

Copy link

@mira-shukla mira-shukla left a comment

Choose a reason for hiding this comment

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

really great work overall just some small improvements :)

@mira-shukla mira-shukla added the reviewed A mentor has reviewed this code label Apr 14, 2023
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