Easy_approach_100%-understandable
This is my first JS program to participate\nso, encourage me to do more and more...\nvote up to do more problem....\n\n/**\n * @param {number[]} nums\n * @param
This is my first JS program to participate\nso, encourage me to do more and more...\nvote up to do more problem....\n```\n/**\n * @param {number[]} nums\n * @param {Function} fn\n * @param {number} init\n * @return {number}\n */\nvar reduce = function(nums, fn, init){\n    if(nums.length==0){\n        return init;\n    }\n    let x=fn(init,nums[0]);\n    let i =1;\n    for(i=1;i<nums.length;i++){\n        x=fn(x,nums[i]);\n    }\n    return x;\n};\n```\n**vote up for more solutions**\n**\uD83D\uDC49VOTE UP\uD83D\uDC48**
['Array', 'JavaScript']