script.js
/**
 * Validates the Christmas light sequence interval, and corrects it if
 * necessary.
 * 
 * @return {number} The corrected lights interval.
 */
Validates the Christmas light sequence interval, and corrects it if
necessary.

@return {number} The corrected lights interval.
Validates the Christmas light sequence interval and corrects it if necessary . @return { number } The corrected lights interval .
function clampLightsInterval() {
  const { value } = christmasLightsInterval;
  if (!value) {
    return 500;
  }
  if (value < 100) {
    return 100;
  } else if (value > 5000) {
    return 5000;
  } else {
    return value;
  }
}
function clampLightsInterval ( ) { const { value } = christmasLightsInterval ; if ( ! value ) { return 500 ; } if ( value < 100 ) { return 100 ; } else if ( value > 5000 ) { return 5000 ; } else { return value ; } }
Validates the Christmas light sequence interval, and corrects it if
 necessary.
Validates the Christmas light sequence interval and corrects it if necessary .
// Grab the value from the Christmas lights interval box. // If none is present, then default to 500. // Clamp the number to a range between 100 (100 milliseconds) and // 5000 (5 seconds). Return the result.