总结:没有区别
参考这篇 StackOverflow 回答:Array VS Type[] in Typescript

当你在ts中想要声明一个数组类型的时候,例如有一个数字列表,以下两种声明都是可以的

  1. // 数组字面量类型声明
  2. let list1: number[] = [1, 2, 3];
  3. // 泛型声明
  4. let list2: Array<number> = [7, 8, 9];
  5. interface IAnimal {
  6. name: string;
  7. weight: number;
  8. height: number;
  9. }
  10. let animals1: IAnimal[] = [{ name: 'leopard', weight: 20, height: 50 }, { name: 'puma', weight: 8, height: 25 }];
  11. let animals2: Array<IAnimal> = [{ name: 'jaeger', weight: 12, height: 18 }, { name: 'cheetah', weight: 45, height: 70 }];

唯一的使用区别

只有在使用readonly修饰符时,两种书写方式才会出现差异
image.png
从typescript3.4之后引入readonly修饰符,并且只允许使用在数组或者元组字面量类型上