$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · medium · #189

What is the output?

const t: [number, string] = [1, 'a'];
console.log(t.length);
  1. 2
  2. 1
  3. 3
  4. undefined
A tuple is an ordinary array at runtime; the type only fixes its shape at compile time.
Play Problem Solving ▸