Simple Javascript solution using for-of loop
\nvar reduce = function(nums, fn, init) {\n    for(let i of nums)\n    {\n        init=fn(init,i)\n    }\n    return init;\n};\n
```\nvar reduce = function(nums, fn, init) {\n    for(let i of nums)\n    {\n        init=fn(init,i)\n    }\n    return init;\n};\n```
['JavaScript']