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'll write an example later. I changed the æ trick to u(), which is on byte more (æ is two bytes) but raises a TypeError (which is expected).