The problem asks to change the 7 spans through selecting all the spans and then changing the color of each of them. Im seeing that this solution works. And also there was another way I found. However, is there any way I can make this solution without a nested for loop? I feel like I'm missing something about using arrays or something. Thanks.
const colors = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet']; //PLEASE DON'T CHANGE THIS LINE!
`enter code here`//YOU CODE GOES HERE:
const spanners = document.querySelectorAll('span');
for( i = 0 ; i < colors.length ; i++){
for(let span of spanners){
span.style.color = colors[i]
i++;
}
}