reduce([1, 2, 3, 4], (acc, x) => acc + x, 0) // β 10reduce<T, U> folds an array into a single value using an accumulator function.
Challenge: Implement reduce<T, U>(arr: T[], fn: (acc: U, x: T) => U, init: U): U.
reduce([1,2,3,4], (acc, x) => acc + x, 0) // β 10