Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialTiffany White
5,373 PointsI have four songs here...
There are four songs here so I don't know wtf I need to do.
[
{
"title" : "Die, Die My Darling",
"artist" : "The Misfits",
"title" : "In Rainbows",
"artist" : "Radiohead",
"title" : "Sadness Is a Blessing",
"artist" : "Lykke Li",
"title" : "You Know You're Right",
"artist" : "Nirvana"
}
]
1 Answer
Damien Watson
27,419 PointsHi Tiffany,
Each song needs to be an individual object, wrapped in brackets. Otherwise you would be overwriting the previous 'title' and 'artist' in the same object. Try this:
[
{
"title" : "Die, Die My Darling",
"artist" : "The Misfits"
},
{
"title" : "In Rainbows",
"artist" : "Radiohead"
},
{
"title" : "Sadness Is a Blessing",
"artist" : "Lykke Li"
},
{
"title" : "You Know You're Right",
"artist" : "Nirvana"
}
]
Damien Watson
27,419 PointsDamien Watson
27,419 PointsThis gives you an array '[]' of 4 objects '{}', each with 'title' and 'artist' properties.
Tiffany White
5,373 PointsTiffany White
5,373 PointsGot it. Thanks!