* Stretch Goal:
* Make the blue and red lights flash alternately.
**/
const redLightsEl = document.getElementsByClassName('red')
const blueLightsEl = document.getElementsByClassName('blue')
setInterval(() => {
for (let i = 0; i < redLightsEl.length; i++) {
redLightsEl[i].classList.toggle('lights-on')
}
setTimeout(() => {
for (let i = 0; i < blueLightsEl.length; i++) {
blueLightsEl[i].classList.toggle('lights-on')
}
}, 800)
}, 800)
/**
* 🎄 Challenge:
* 1. The Christmas tree's lights should switch
* on and off every 800 miliseconds.
*