JavaScript Reduce Method
The JavaScript reduce method takes each value of an array, and applies reducer function such that it changes the array into a single value. Syntax of .reduce() method: array.reduce((accumulator, currentValue, index, array) =>{....}, initialValue} The .reduce() method takes two arguments : 1. The first is reducer function, which is