Array.prototype.reduce()

Codewars task:

Given a non-empty array of integers, return the result of multiplying the values together in order.

Example:

[1, 2, 3, 4] => 1 * 2 * 3 * 4 = 24

Solution:

const grow = x => { 
    let result = 1; 
    x.map(i => result*= i); 
    return result 
}

const grow = x => x.reduce((a, b) => a * b)

grow([1, 2, 3])                                         // Output: 6

Explanation:

The reduce() method executes a user-supplied "reducer" callback function on each elementthe array, in order, passing in the return value from the calculation on the precedelement. The final result of running the reducer across all elements of the array isingle value.