Back to Type Challenges

README.Zh CN

questions/03057-easy-push/README.zh-CN.md

latest2.1 KB
Original Source
<!--info-header-start--><h1>Push </h1><blockquote><p>by jiangshan <a href="https://github.com/jiangshanmeta" target="_blank">@jiangshanmeta</a></p></blockquote><p><a href="https://tsch.js.org/3057/play/zh-CN" target="_blank"></a> &nbsp;&nbsp;&nbsp;<a href="./README.md" target="_blank"></a> <a href="./README.ja.md" target="_blank"></a> <a href="./README.ko.md" target="_blank"></a> </p><!--info-header-end-->

在类型系统里实现通用的 Array.push

例如:

typescript
type Result = Push<[1, 2], '3'> // [1, 2, '3']
<!--info-footer-start-->

<a href="../../README.zh-CN.md" target="_blank"></a> <a href="https://tsch.js.org/3057/answer/zh-CN" target="_blank"></a> <a href="https://tsch.js.org/3057/solutions" target="_blank"></a> <hr><h3>相关挑战</h3><a href="https://github.com/type-challenges/type-challenges/blob/main/questions/00533-easy-concat/README.zh-CN.md" target="_blank"></a> <a href="https://github.com/type-challenges/type-challenges/blob/main/questions/03060-easy-unshift/README.zh-CN.md" target="_blank"></a> <!--info-footer-end-->