ts

143 阅读1分钟

ts

let hd: Array<string | number>  //  Array<string | number>  泛型的写法
let hd:(string | number)[]  //  Array<string | number>  普通的写法
hd.push('a')
console.log(hd)