10. Timers Intervals πŸ‘©β€πŸŽ“πŸ‘¨β€πŸŽ“

πŸ“– Create a Speed-Reader

Implement the following user story:

  • As a developer, I want to create a speed-reading application that prints a single word of a message at a time.

Acceptance Criteria

  • It’s done when the number of seconds left on the countdown is printed on the screen.

  • It’s done when, after the countdown of 5 seconds ends, the words of the message appear on the screen, one word at a time.

πŸ“ Notes

Refer to the documentation:

MDN Web Docs on setInterval()

MDN Web Docs on clearInterval()

Assets

The following animation demonstrates the web application’s appearance and functionality:

A countdown of 5 seconds begins and then single words appear on the screen.

πŸ’‘ Hints

How is displayMessage() utilizing the setInterval() and clearInterval() methods to display the words at an interval of 1000 milliseconds?

πŸ† Bonus

If you have completed this activity, work through the following challenge to further your knowledge:

  • What window method is used to delay an action for a set number of milliseconds? Why might this method be useful?

Use Google or another search engine to research this.


βœ… Solutions

Solutions Click Here