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 :(
this looks great, i love using
æ
as a shortcut for throw. can you write a quick html example?