定义固定长度的数组
最后更新于
这有帮助吗?
最后更新于
这有帮助吗?
来源:
Typescript 3 introduces
The last element of a tuple type can be a rest element of the form ...X, where X is an array type
To restrict the length of a tuple we can use intersection with { length: N }
定义类型
那么定长为6的数组就是