Assessment wanted for Object basics 2 skill test

// this is the task

Object basics 2

In our next task, we want you to have a go at creating your own object literal to represent one of your favourite bands. The required members are:

  • name : A string representing the band name.
  • nationality : A string representing the country the band comes from.
  • genre : What type of music the band plays.
  • members : A number representing the number of members the band has.
  • formed : A number representing the year the band formed.
  • split : A number representing the year the band split up, or false if they are still together.
  • albums : An array representing the albums released by the band. Each array item should be an object containing the following members:
    • name : A string representing the name of the album.
    • released : A number representing the year the album was released.

Include at least two albums in the albums array.
// stuck here
Once you’ve done this, you should then write a string to the variable bandInfo , which will contain a small biography detailing their name, nationality, years active, and style, and the title and release date of their first album.

// my solution
let bandInfo;

// Put your code here
bandInfo = {
name: ‘yomi’,
nationality: ‘Nigeria’,
Genre: ‘Fuji’,
Formed: 2013,
Split: false,
Albums: {
name: [‘Rich may doubt’, ‘The poor untouched’, ‘The grown menace’],
Released: [2017, 2019, 2018]
}
}

Thanks

Hi there @Olayiwola_Toyeeb, and thanks for sending your code into us!

You are on the right track here; have a look at our version for a bit, and then try to implement it yourself: https://github.com/mdn/learning-area/blob/master/javascript/oojs/tasks/object-basics/marking.md#task-2

I was having a weird experience with this exercise. Single quotes showed the object reference where back tick used in the github answer produced the value. When does one use a back tick vs single quote?
${band.genre} using ’ ’
Heavy Metal using back tick

Hi @Paul_Buencamino and welcome to the community :wave:

You will use single quotes (or double quotes) when you use a literal string.
When you like to use variables inside your string, you will use back ticks and wrap the variable in ${...}.

It’s possible to use literal strings and variables concatenated with the “plus” sign, but in my opinion that’s not as easy to read as the other version:

'His dog is called ' + name + ' and is ' + age + ' years old.';
`His dog is called ${name} and is ${age} years old.`;

Happy New Year,
Michael

I can offer an alternative solution which has suttle differences in setting up the objects in the Albums Array.

const favBand = {
name: “RadioHead”,
nationality: “American”,
genre: “alternative”,
members: 5,
formed:1985,
split: false,
albums:[ //array where each value in array has two datatypes
{name: “Ok Computer”, released: 1997},
{name: “In Rainbows”, released:2007},
{name: “Kid A”, released:2000},
],

}