Simple || Easy || JS
/*\n * @param {number[]} nums\n * @param {Function} fn\n * @param {number} init\n * @return {number}\n /\n\nvar reduce = function(nums, fn, init) {\n    let val
/**\n * @param {number[]} nums\n * @param {Function} fn\n * @param {number} init\n * @return {number}\n */\n```\nvar reduce = function(nums, fn, init) {\n    let val = init \n    for( let i = 0 ; i < nums.length ; i++ ){\n        val =fn(val,nums[i])\n    }\n    return val\n};\n```
[]