TypeScript · Senior · Question 10 of 75
What are variadic tuple types?
type Concat<A extends unknown[], B extends unknown[]> = [...A, ...B];- ✓Correct answer: Tuples where spreading generic tuples preserves exact element types
- 2Tuples without a length limit, equivalent to
any[]in TS - 3Tuples whose elements the compiler lets you reorder
Explanation
Concat<[1, 2], ['a']> → [1, 2, 'a']. This lets you precisely type concat, curry, Promise.all and wrapper functions with prefix arguments.