Command Palette

Search for a command to run...

Hectal
Phase 5: Arrays, Tuples, Enums and Special Types
TypeScript · Exercise 6 of 6 Previous
Intermediate

Zip Names and Scores

Build a small real helper. zip pairs each name with its score and should return a list of [name, score] tuples. It must accept both normal and read-only arrays.

Make the signature say so: read-only parameters and a return type of tuples [string, number][]. The checks pass frozen arrays in and assign the result to a tuple list.

What Check tests

  1. Your code has no type errors
  2. The result is a list of [string, number] tuples
  3. Frozen arrays are accepted
  4. Each row is a pair
  5. The console prints Ravi:72

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.