533 - Concat

Author: VarunMendreCreated Sep 7, 2026Updated Sep 7, 2026
Labelsansweren533
// Use `readonly unknown[]` instead of `unknown[]` so that both mutable
// and readonly tuples (e.g. created with `as const`) satisfy the constraint.
type Tuple = readonly unknown[];

// Spread both tuples into a new tuple type, preserving element order and types.
type Concat<T extends Tuple, U extends Tuple> = [...T, ...U];   

Source: type-challenges/type-challenges