Reducing an array The array reduce function takes a reducing function and an accumulator. const values = ['a', 'b', 'c']// This function is called once for each element in the array.function reducer(accumulator: string, value: string) { return `reduce(${ accumulator }, ${ value })`}console.log(values.reduce(reducer, 'initial'))