This is from “Learn Basic String and Array Methods by Building a Music Player” step 59.
This is setting the aria-label in the HTML code to the second parameter, right? Why do we need to set aria-label to "Play ${song.title} or “Play”? I don’t see any interactions with javascript and html using aria-label. Is it just keeping it properly structures/clean code? Is it for visually impaired people?
const setPlayButtonAccessibleText = () => {
const song = userData?.currentSong || userData?.songs[0];
playButton.setAttribute(“aria-label”, song?.title? Play ${song.title}
:“Play”)
};