Fetch the repository succeeded.
/*
3057 - Push
-------
by jiangshan (@jiangshanmeta) #简单 #array
### 题目
在类型系统里实现通用的 ```Array.push``` 。
例如:
```typescript
type Result = Push<[1, 2], '3'> // [1, 2, '3']
```
> 在 Github 上查看:https://tsch.js.org/3057/zh-CN
*/
/* _____________ 你的代码 _____________ */
type Push<T extends Array<any>, U> = [...T,U]
/* _____________ 测试用例 _____________ */
import type { Equal, Expect } from '@type-challenges/utils'
type cases = [
Expect<Equal<Push<[], 1>, [1]>>,
Expect<Equal<Push<[1, 2], '3'>, [1, 2, '3']>>,
Expect<Equal<Push<['1', 2, '3'], boolean>, ['1', 2, '3', boolean]>>,
]
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。