Command Palette

Search for a command to run...

Hectal
Phase 2: Seeing Data: Choosing the Right Chart
Data Visualization · Exercise 1 of 4Next
Beginner

Name the kind of a column

Write kindOf(values), which takes an array of strings (a CSV column) and returns "time", "quantitative" or "categorical".

A column is "time" when every value looks like an ISO date (2025-06-02). It is "quantitative" when every value is a number and none starts with a zero followed by another digit (an ID such as 07790 is a label). Everything else is "categorical". Ignore empty strings (missing values).

What Check tests

  1. Dates in ISO form are "time"
  2. Numbers are "quantitative" (a missing value is ignored)
  3. Station codes are "categorical"
  4. Numbers with a leading zero are labels
  5. An empty column is "categorical", not an error

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.

Console

Nothing printed yet.