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

NW5 Manchester - Doris Siu - JS2 - Week1 #119

Open
Doris-Siu wants to merge 3 commits intoCodeYourFuture:mainfrom
Doris-Siu:main
Open

NW5 Manchester - Doris Siu - JS2 - Week1 #119
Doris-Siu wants to merge 3 commits intoCodeYourFuture:mainfrom
Doris-Siu:main

Conversation

@Doris-Siu
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:Doris Siu
  • Your City: Manchester
  • Your Slack Name: Doris Siu

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?


let myCountry = "UnitedKingdom";
let myCapitalCity; // complete the code
let myCapitalCity = capitalCities["UnitedKingdom"]; // complete the code
Copy link

Choose a reason for hiding this comment

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

this works, but you have the myCountry variable available to you so you can also use this in the bracket notation :)

Comment on lines +24 to +26
let topPlayersArr = basketballTeam.topPlayers.sort();

topPlayersArr.forEach(player => console. log(player));
Copy link

Choose a reason for hiding this comment

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

really good, well done

Comment on lines +28 to +30
capitalCities.Peru = {};
capitalCities.Peru.name = "Lima";
capitalCities.Peru.population = 975000;
Copy link

Choose a reason for hiding this comment

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

this works, you can also set the properties of the Peru object all at once, by setting the name & population when you create the object

*/

// write code here
student["attendence"] = 90;
Copy link

Choose a reason for hiding this comment

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

good use of bracket notation here


console.log(myPet.getName());

// Because in the object method, it omits the keyword return for the string.
Copy link

Choose a reason for hiding this comment

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

good explanations for why JavaScript is returning undefined

}
console.log(Object.entries(fish));

function printRecipe(obj) {
Copy link

@Nomes27 Nomes27 Oct 16, 2022

Choose a reason for hiding this comment

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

this is really good and it's clear you have a good understanding of accessing object keys & values. The question asks for each recipe to be in this format when console.log is used:

  Mole
  Serves: 2
  Ingredients:
  cinnamon
  cumin
  cocoa

Can you think of ways you might change your approach so that it follows this format? (for example not having the title key logged & having the ingredients on a new line)

Comment on lines +22 to +26
let result = {};
for (let [country, currency] of countryCurrencyCodes) {
result[country] = currency;
}
return result;
Copy link

Choose a reason for hiding this comment

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

really good, well done :)

// write code here
let result = {};
result.name = recipe["name"];
let pantryArr = pantry.fridgeContents.concat(pantry.cupboardContents);
Copy link

Choose a reason for hiding this comment

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

I really like how you use concat here to combine the fridge & cupboard items first to make it easier to search through

Comment on lines +24 to +31
orderBurger: function (balance) {
if (balance >= MENU.burger) {
let newBalance = balance - MENU.burger;
return newBalance;
} else {
return balance;
}
},
Copy link

Choose a reason for hiding this comment

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

good job here, this is a very clear solution & your variable names make it easy to understand if you are unfamiliar with the code

// write code here

return wordCount;

Copy link

Choose a reason for hiding this comment

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

great job making it onto the extra tasks and on having passing tests! A shorthand way of doing wordCount[word] = wordCount[word] + 1; would be wordCount[word] += 1;

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