Slider Autoplay Quiz

Quiz 2 4 questions

Prerequisites for the quiz

  1. The Slider Autoplay chapter

Are you ready?

4 questions to solve

Instructions
  1. This quiz goes to full-screen once you press the Start button.
  2. At the end of the quiz, you are able to review all the questions that you answered wrong and see their explanations.
What's missing in the following definition for Autoplay.reset()?
Autoplay.reset = function() {
   this.start();
}
Autoplay.reset() serves to clear the ongoing timer and then start a new one by calling the start() method. Hence the choice B).
What's the problem in the setInterval() function below, to automatically navigate to the next slide after 5s?
setInterval(navigateSlider, 5000);
If you read the previous Slider Autoplay chapter, then you'll see that we've discussed this very problem in it. Here, since we're directly passing navigateSlider to setInterval() we are missing the incrementing expression for newIndex, which causes the problem. This goes with choice A). Read the previous chapter to see how to mitigate this.
What's the purpose of the property id on the Autoplay object?
Autoplay.id holds the ID returned by setInterval() to help in clearing it in future. Hence the choice B).
What's the type of the global variable autoplay, as returned by typeof?
automate is a Boolean global to indicate whether Autoplay shall be applied to the slider, or not.