타입스트립트에서 타이핑이 적용된 배열에 대해 reduce를 사용하려고 하면 타입 에러가 발생한다.
초기 배열이 일반 배열로 선언되기 때문에 발생하는 에러이다. 초기 배열을 배열의 타이핑으로 인식시켜주면 에러가 더 이상 발생하지 않는다.
['a', 'b', 'c'].reduce((accumulator, value) => accumulator.concat(value), [] as string[]);
https://stackoverflow.com/questions/54117100/why-does-typescript-infer-the-never-type-when-reducing-an-array-with-concat