百度已收录

声明数字类型的数组

let arrOfNumbers: number[] = [1, 2, 3]
// arrOfNumbers.push('123') // Argument of type '"123"' is not assignable to parameter of type 'number'.

元祖

let user: [string, number] = ['viking', 20]