Skip to content

[Bug] reduce passes incorrect index when initialValue is excluded #26

@mhassan1

Description

@mhassan1

Describe the bug
The reduce implementation passes the incorrect index value when initialValue is excluded; it should start at 1, instead of 0.

To Reproduce

Iterator.from([1,2,3]).reduce((s, v, i) => i)
// -> 1

Expected behavior
Should return 2.

Screenshots
N/A

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions