Array Reduce Function Typescript Playground