andrewplummer/Sugar — pull request #73 by milaniliev (2011-12-09 16:33:11+00:00)
Title: Array#reduce does not follow semantics when 0 is given as initialValue

Hi,

Array#reduce does not work as documented when 0 is given as an initialValue, since `if(initialValue)` is false for the value of 0. Instead, I propose we check for `null` & `undefined`.

This problem doesn't manifest itself in new browsers (i.e. Chrome 17) that implement Array#reduce natively; they handle a 0 initial value correctly.

Thanks!
Milan