Array type notation: `T[]` vs. `Array ` in TypeScript
Briefly

This blog post discusses the two notations for arrays in TypeScript: T[] and Array<T>. It notes TypeScript's preference for T[] due to historical reasons and usage in type inference. However, the author argues in favor of Array<T> for its clarity, especially when working with more complex element types. The strong binding of the square brackets in T[] can pose challenges, and it is suggested that linting tools can help enforce consistency in notation style. Ultimately, while both are functionally the same, there are compelling reasons to choose one over the other.
In TypeScript, there are two notations for an Array of strings: T[] and Array<T>. Both notations are equivalent, but there are reasons to prefer one over the other.
Generics were introduced in TypeScript 0.9. TypeScript almost exclusively uses T[] when inferring types, which has led to a preference for this syntax.
I find the Array<T> notation often looks better, especially as the complexity of constructs related to element types increases. It provides enhanced readability.
Additionally, the strong binding of square brackets in T[] requires extra care with complex types. This can lead to confusion without proper parentheses.
Read at 2ality
[
|
]