Command Palette

Search for a command to run...

Hectal
Phase 16: Dashboards in Production
Data Visualization · Exercise 1 of 5Next
Beginner

A change that never says Infinity

The helper changeText(now, before) prints Infinity% or NaN% when there is nothing to compare with.

Make it return no earlier value when before is 0, missing or not a number, and keep up 20.0% / down 10.0% for normal cases.

What Check tests

  1. A rise reads up 20.0%
  2. A fall reads down 10.0%
  3. A zero before says no earlier value
  4. A missing before says no earlier value
  5. No line prints Infinity or 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.