Back to Type Challenges

README.Zh CN

questions/03192-medium-reverse/README.zh-CN.md

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

实现类型版本的数组反转 Array.reverse

例如:

typescript
type a = Reverse<['a', 'b']> // ['b', 'a']
type b = Reverse<['a', 'b', 'c']> // ['c', 'b', 'a']
<!--info-footer-start-->

<a href="../../README.zh-CN.md" target="_blank"></a> <a href="https://tsch.js.org/3192/answer/zh-CN" target="_blank"></a> <a href="https://tsch.js.org/3192/solutions" target="_blank"></a> <!--info-footer-end-->