// -----------------------------------------------
interface arg {
[index:number]:[number,string,boolean]
}
const arr :arg = [[1,'1',true]]
for(const i of arr){
console.log(i)
}
// -----------------------------------------------
// 需要将 arr的类型 [number,string,boolean][] 抽离出来复用
// 但显示TS报错 "message": "类型“arg”不是数组类型或字符串类型,或者没有返回迭代器的 \"[Symbol.iterator]()\" 方法。"
// 目前的解决方案
// interface arg extends Array<[number,string,boolean]> {
// [index:number]:[number,string,boolean]
// }
// 有没有更好的写法
这里用 type 就行了,不需要 interface 。(类型最好首字母大写)