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