Command Palette

Search for a command to run...

Hectal
Phase 17: Storytelling and Scrollytelling
Data Visualization · Exercise 1 of 6Next
Beginner

A headline that can say nothing

finding(a, b) takes two lists of daily rides and should return a headline such as 2.5 times. With an empty list or a base of zero it returns NaN times or Infinity times.

Make it return null when either list is empty, or when the average of b is 0. Keep the normal case.

What Check tests

  1. The normal case still works
  2. An empty list gives null
  3. A base of zero gives null

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.