Using “data.item.artists[0].name” to name other artists, spotify


After searching the internet for a web based now playing viewer I found this one:
It works brilliantly but I wish to add the ability to see any other artists featured on a song.

I tried using the already inputted code <div class="now-playing__artist">${data.item.artists[0].name} </div>
so that it looked like this: <div class="now-playing__artist">${data.item.artists[0].name}, ${data.item.artists[1].name} </div> This worked for any songs that had a second artist but if a song only had 1 artist it would break and not display anything.

Would their be a way have the other artist displayed while also being able to one display 1 without it breaking?

Sorry if it is vague, any questions just ask!

Original code found here: