-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(reduce/scan): both scan/reduce operators now accepts
undefined
…
…itself as a valid seed (#2050) * fix(scan): scan operator now accepts `undefined` itself as a valid seed value Array#reduce supports `undefined` as a valid seed value, so it seems natural that we would too for scan ```js of(1, 2, 3).scan((acc, x) => acc + ' ' + x, undefined); // "undefined 1" // "undefined 1 2" // "undefined 1 2 3" ``` fixes #2047 * fix(reduce): reduce operator now accepts `undefined` itself as a valid seed value Array#reduce supports `undefined` as a valid seed value, so it seems natural that we would too. ```js of(1, 2, 3).reduce((acc, x) => acc + ' ' + x, undefined); // "undefined 1 2 3" ```
- Loading branch information
Showing
4 changed files
with
81 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters