Sonification: plan the notes, play on a click
The checker cannot hear, so this example only logs the planned frequencies. play() is the real code path: it runs when a person presses the button.
Accessibility is not only for screen readers. Check that marks have enough contrast in both themes, that the page reflows at high zoom, that motion respects the reader's setting, and consider sound as another way to hear a trend.
Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.
Ready for more? This phase has 5 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
Compute the contrast of #767676 text on white. Is it enough for body text?
Write a function playOne(hz) that plays one half-second note and fades it out.
Explain it without notes
What are the two contrast rules for a chart and what ratios do they need?
Why can colour not be the only signal?
How does the dashboard respect reduced motion in one place?
Why does sonification wait for a click?
Console
(nothing was printed)Expected console output
Mon 2979 -> 220 Hz
Tue 3992 -> 880 Hz
Wed 3759 -> 728 Hz
Thu 3742 -> 717 Hz
Fri 3648 -> 656 Hz
Sat 3013 -> 242 Hz
Sun 3451 -> 528 Hz
with a gap: 220, rest, 880
all equal: 550, 550
Button added; play() is defined and has not been called.