class Hero { name: string = '' } const heroes: Hero[] = []; const heroes2 = [] as Hero[];
我注意到在 TypeScript 中声明数组有两种不同的方法。我想知道这是否只是语法糖,还是我缺少一些潜在的逻辑?
typescript
typescript ×1