Level 1M4Lesson 4.6

beginner35 minby DevFox

Simple tuples

Keep a task and its minutes together in a tuple: an array with a fixed number of places, each with a type of its own. Write the type as [string, number], read each place by its index, and sort, search and add up a whole list of pairs without a task ever losing its minutes. See why TypeScript makes a plain list unless you write the tuple’s type, and what TS2493 means when you count places from 1.

  • Fundamentals
  • TypeScript
Simple tuples. Read this lesson at .