I’m Kinda new to TypeScript and was wondering what is the difference between,
let array: SomeClass[]; and
let array: [SomeClass];?
What does the different positions of the brackets mean?
>Solution :
The answer is to do with the amount of instances in each array
someClass[] will mean an array with an infinate length of that class
[someClass] will mean a tuple with a length of one of that class
Ie
someClass[] can be: [someClass], [someClass, someClass] or [someClass, someClass, someClass, someClass] with any amount of values
Whereas [someClass] can only be: [someClass] and no other amount of values in the array