questions/00018-easy-tuple-length/README.zh-CN.md
创建一个Length泛型,这个泛型接受一个只读的元组,返回这个元组的长度。
例如:
type tesla = ['tesla', 'model 3', 'model X', 'model Y']
type spaceX = ['FALCON 9', 'FALCON HEAVY', 'DRAGON', 'STARSHIP', 'HUMAN SPACEFLIGHT']
type teslaLength = Length<tesla> // expected 4
type spaceXLength = Length<spaceX> // expected 5
<a href="../../README.zh-CN.md" target="_blank"></a> <a href="https://tsch.js.org/18/answer/zh-CN" target="_blank"></a> <a href="https://tsch.js.org/18/solutions" target="_blank"></a> <!--info-footer-end-->