script.js
/**
 * Lights the next bulb of the Christmas light sequence.
 */
Lights the next bulb of the Christmas light sequence.
Lights the next bulb of the Christmas light sequence .
function lightNextBulb() {
  if (activeLight >= 0) {
    christmasLights[activeLight].style.backgroundColor = 'transparent';
    christmasLights[activeLight].style.boxShadow = nonActiveShadow;
  }
  activeLight++;
  if (activeLight >= christmasLights.length) {
    activeLight = 0;
  }
  christmasLights[activeLight].style.backgroundColor = lightColors[activeLight];
  christmasLights[activeLight].style.boxShadow = `${activeShadow} ${lightShadowColors[activeLight]}`;
}
function lightNextBulb ( ) { if ( activeLight >= 0 ) { christmasLights [ activeLight ] . style . backgroundColor = 'transparent' ; christmasLights [ activeLight ] . style . boxShadow = nonActiveShadow ; } activeLight ++ ; if ( activeLight >= christmasLights . length ) { activeLight = 0 ; } christmasLights [ activeLight ] . style . backgroundColor = lightColors [ activeLight ] ; christmasLights [ activeLight ] . style . boxShadow = ` ${ activeShadow } ${ lightShadowColors [ activeLight ] } ` ; }
Lights the next bulb of the Christmas light sequence.
Lights the next bulb of the Christmas light sequence .
// In-activate the previous light in the sequence, if there is one. // Advance the light index. Reset to zero if necessary. // Activate the next light.