Command Palette

Search for a command to run...

Hectal
Phase 9: Motion
Data Visualization · Exercise 3 of 4 PreviousNext
Intermediate

Respect reduced motion

showBar(width, reduced) should set the bar's width at once when reduced is true, and slide to it over 300 ms when it is false. Both paths must give the same final width.

Fix it so that showBar(200, true) has set the width before the function returns.

What Check tests

  1. With reduced = true the width is set at once
  2. With reduced = false the bar is not there yet, then arrives
  3. No attribute holds NaN

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.

Console

Nothing logged yet.