- Never use
any
. - In case there's no alternative, use
unknown
(more aboutunknown
). - Use ReadOnly arrays to ensure there's no scope for mutation (unless mutation is needed).
const numbers: ReadonlyArray<number> = [1, 2, 3];
- Array generics over typecasting.
const numbers: Array<number>;
//instead of const numbers: any[];