Please enable JavaScript to use CodeHS

Introduction to Computer Science in JavaScript (Golden) (2022)

Lesson 9.1 Timers

Description

In this lesson, students will be introduced to the concept of using timers for animation. Now instead of having graphics programs that stay the same, the content changes every time the timer runs. The first program students will see is a moving ball, so discussing this with the class as a demo on the projector is very useful.


Objective

Students will be able to:

  • Explain in their own words how animation works
  • Create animation in programs using the setTimer function
  • Explain what a callback function is