function reducer(accumulator, currentValue, currentIndex, array){} Code language: JavaScript (javascript)