在类型系统里实现类似 JavaScript 中的 Array.push 方法 Push<T, U> ,这个类型接受两个参数,第一个参数为元组类型,第二个参数为任意类型。
Array.push
Push<T, U>
例如:
type Result = Push<[1, 2], '3'> // [1, 2, '3']
TypeScript