We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import {pipe, reduce} from 'iter-ops'; const input = [3, 0, -2, 5, 9, 4]; const i = pipe(input, reduce((prev, curr, idx, state) => { console.log(idx); return prev; })); const r = [...i];
Expected Output: 1 2 3 4 5
1 2 3 4 5
Actual Output 2 4 6 8 10
2 4 6 8 10
As a test against the standard reduce...
input.reduce((prev, curr, idx)=>{ console.log(idx); return prev; });
Outputs: 1 2 3 4 5
input.reduce((prev, curr, idx)=>{ console.log(idx); return prev; }, 0);
Outputs: 0 1 2 3 4 5
0 1 2 3 4 5
The text was updated successfully, but these errors were encountered:
fixing #172
7d0960d
Merge pull request #173 from vitaly-t/reduce-index-fix
af08db5
This issue was fixed and released in v2.1.1
Sorry, something went wrong.
No branches or pull requests
Expected Output:
1 2 3 4 5
Actual Output
2 4 6 8 10
As a test against the standard reduce...
Outputs:
1 2 3 4 5
Outputs:
0 1 2 3 4 5
The text was updated successfully, but these errors were encountered: