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 trialAaron McGlothin
Full Stack JavaScript Techdegree Student 1,764 PointsPlaylist-2
const playlist = [
['So What', 'Miles Davis', '9:04'],
['Respect', 'Aretha Franklin','2:45']
['What a Wonderful World', 'Louis Armstrong', '2:21'],
['At Last', 'Ella Fitzgerald', '4:18'],
['Three Little Birds', 'Bob Marley and the Wailers', '3:01'],
['The Way You Look Tonight', 'Frank Sinatra', '3:21']
];
const myArtist =${playlist}[0][1]}, ${playlist}[1][1]}, ${playlist}[5][1]}
;
console.log(myArtist);
function createListItems( arr ) {
let items = '';
for ( let i = 0; i < arr.length; i++ ) {
items += <li>${ arr[i][0]} ${ arr[i][1] } - ${ arr [i][2] } </li>
;
}
return items;
}
document.querySelector('main').innerHTML =
<ol>
${createListItems(playlist)}
</ol>
;
I am totally stuck
1 Answer
jb30
44,806 Points const myArtist =`${playlist}[0][1]}, ${playlist}[1][1]}, ${playlist}[5][1]}`;
should be
const myArtist =`${playlist[0][1]}, ${playlist[1][1]}, ${playlist[5][1]}`;
without the }
between playlist
and [
.
There should be a ,
between ['Respect', 'Aretha Franklin','2:45']
and ['What a Wonderful World', 'Louis Armstrong', '2:21']
.