元组

元组

any[] 可以存储任意类型的数组,元组可以作为参数传递给函数

1
2
let x: [string, number];
x = ['string', 1] // true