Array Reduce Transformation | JS Solution | Beats 95.37%🕐
Code
# Code
```javascript []
/**
 * @param {number[]} nums
 * @param {Function} fn
 * @param {number} init
 * @return {number}
 */
var reduce = function(nums, fn, init) {
    let accum = init;

    for(let num of nums){
        accum = fn(accum, num);
    }

    return accum;
};
```
['JavaScript']