Command Palette

Search for a command to run...

Hectal
Phase 4: Data in the Browser
Data Visualization · Exercise 5 of 5 Previous
Intermediate

Clean one number

Write toNumber(text): "1193" gives 1193, "2,016" gives 2016 (a thousands comma), and "" and "n/a" give null (missing, never 0).

The page lists the results of four inputs. Make the list read 1193, 2016, null, null.

What Check tests

  1. The list reads 1193, 2016, null, null
  2. The code handles the comma

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.