A 140 bytes Array.prototype.reduce solution.
It should work as described on MDN.
If the array has no value and no initial value is passed, it raises an error. If the callback is not a function, it will fail when tempting to call it.
There is one major difference between ES5 specifications and this implementation: if the second parametter is specified but undefined
, it won't be taken as initial value. There is no place to put a arguments.length
here :(
I wonder why initial value in Chrome can't be an empty array!