type Concat<T extends unknown[], U extends unknown[]> = [...T, ...U];↵
type Push<T extends unknown[], V> = [...T, V];↵
type Unshift<T extends unknown[], V> = [V, ...T];↵
type A = [1, 2];↵
type B = [3, 4];↵
type AB = Concat<A, B>;↵
type Pushed = Push<A, 5>;↵
type Unshifted = Unshift<B, 0>;↵
const ab: AB = [1, 2, 3, 4];↵
const pushed: Pushed = [1, 2, 5];↵
const unshifted: Unshifted = [0, 3, 4];↵
console.log(ab);↵
console.log(pushed);↵
console.log(unshifted);