Ruby Reduce Function In Typescript Documentation