Assessment wanted for Object basics skill tests

Hi, could you please assess my code for Object basics skill tests?
I do appreciate for your review beforehand.

p.s. along my learning process I have been using codepen online editor but when I started to take steps forward during learning JS I decided to create github repositories for MDN tests and assessments even if I yet know less how to use github properly. so my question is that if it is a good idea creating github repositories for assessments requests or I just should continue to use codepen?

Hi @bedribulut

Here are some comments:

  • Task 1: You missed “Run the greeting() method using dot notation (it will log the greeting to the browser’s console)”.
  • Task 2: You could simplify for example ${myFavBand['albums'][0]['name']} to ${myFavBand.albums[0].name}.
  • Task 3 + 4: Everything’s fine.

so my question is that if it is a good idea creating github repositories for assessments requests or I just should continue to use codepen?

I think it’s a great idea to use GitHub for the MDN exercises. You will learn about the basics of Git and how a Git hosting platform works. So yes, keep using GitHub.
Something you could look into are GitHub Pages. When you activate this feature for your repo you can deploy your projects to a GitHub domain and it can be access like every other web site.
https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site

Cheerio,
Michael

1 Like

thank you so much for your valuable advice regarding both tasks and using GitHub.
I just also uptaded the code for task 1 and task 2.

have a nice day.

For task 1 the idea is to call the object’s function like this cat.greeting();.
Task 2 looks much cleaner now. I recommend using always dot notation except when the property name is dynamic.

This is an example where you need to use bracket notation:

const greetings = {
  greetEN: 'Hi',
  greetDE: 'Hoi'
};
const lang = 'DE';
console.log(greetings['greet' + lang]);
1 Like

thank you so much for your understandable explanation @mikoMK
have a nice day

1 Like