Free activity · ages 8 to 14 · about 1 hour

Code a beat in real JavaScript

Snap blocks together to build a drum beat and a tune. Every block turns into a line of real code, and the computer plays it. Six short steps, then print your certificate.

For teachers and grown-ups

Kids snap blocks into a beat and watch each one become real JavaScript. They practise sequences (order matters), loops (repeat and loop forever) and values (tempo and notes), and they debug as they go. Computers, including AI music tools, run on instructions like these.

  • About 60 minutes: six steps of 5 to 8 minutes each, then free remixing and a printable certificate.
  • No accounts, nothing collected. Progress is saved on this device only. The certificate name is never stored or sent.
  • Works offline once the page has loaded, on Chromebooks, iPads, phones and computers.
  • Sound: headphones help in a classroom. On an iPad or iPhone, turn off silent mode.

Step 1 of 6

Make a sound

Need a hint?

Checklist

    Blocks

    Tap a block to add it. More blocks unlock as you go.

    Your program

      Your JavaScript

      
              

      This is real JavaScript, the language of the web. Each block makes one line. Lines that start with // are notes for humans.

      How do kick() and repeat() work?
      // Each sound plays, then waits half a beat.function repeat(times, steps) {  for (let i = 0; i < times; i++) {    steps();  }}

      Add blocks, then press Play.

      The finish line

      Your certificate

      Finish all 6 steps to unlock your certificate.