Code speaks better than language, so:
['a', 'b', 'c'].reduce((accumulator, value) => accumulator.concat(value), []);
The code is very silly and returns a copied Array...
TS complains on concat's argument: TS2345: Argument of type 'string' is not assignable to parameter of type 'ConcatArray'.
[]
is inferred to benever[]
". If that was the case then why doesconst array = [];
inferarray
as typeany[]
? β Muliebrity