3 ms·
Er, the single-parameter version of reduce differs from the two-parameter version in that the semantics are changed to literally skip the callback invocation wh
by carussell 9y ago
Er, the single-parameter version of reduce differs from the two-parameter version in that the semantics are changed to literally skip the callback invocation where the first element gets passed as x. Instead of being called n times, it gets called n-1 times. It's one of the most clear-cut manifestations of fences vs posts—the quintessential off-by-one problem.