// 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, orfalse
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