How do I write a simple for loop to iterate over span elements and assign each one a color from an array in an indexical order? So the B will be red, the E orange etc.
const colors = ['red', 'orange', 'yellow', 'green'];
<h1>
<span>B</span>
<span>E</span>
<span>A</span>
<span>R</span>
</h1>