New issue

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

Issues with "Array.prototype.reduce" and "Array.prototype.reduceRight" #744

Closed
fpelliccioni opened this Issue Dec 5, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@fpelliccioni

fpelliccioni commented Dec 5, 2016

At 22.1.3.19 Array.prototype.reduce ( callbackfn [ , initialValue ] )

callbackfn should be a function that takes four arguments. reduce calls the callback, as a function, once for each element present in the array, in ascending order.

The callback function is called N - 1 times, where N is the number of elements in the array (when initialValue is not present).

Same error at 22.1.3.20 Array.prototype.reduceRight ( callbackfn [ , initialValue ] )

callbackfn should be a function that takes four arguments. reduceRight calls the callback, as a function, once for each element present in the array, in descending order.

@getify

This comment has been minimized.

Show comment
Hide comment
@getify

getify Dec 5, 2016

Contributor

The algorithm (below this text) is accurate. This text (slightly misleading in that it's incomplete) is only in the Note 1, which is only informal (aka non-normative) human description.

Contributor

getify commented Dec 5, 2016

The algorithm (below this text) is accurate. This text (slightly misleading in that it's incomplete) is only in the Note 1, which is only informal (aka non-normative) human description.

@littledan

This comment has been minimized.

Show comment
Hide comment
@littledan

littledan Dec 6, 2016

Member

@fpelliccioni Nice catch! It'd be a great next step if you want to write a pull request against the spec (in spec.html of this repository) with fixed non-normative text. I really appreciate your help; in my opinion, the non-normative text is a really important part for users and implementers to be able to understand the spec.

Member

littledan commented Dec 6, 2016

@fpelliccioni Nice catch! It'd be a great next step if you want to write a pull request against the spec (in spec.html of this repository) with fixed non-normative text. I really appreciate your help; in my opinion, the non-normative text is a really important part for users and implementers to be able to understand the spec.

@bterlson bterlson closed this in 72dc5b3 Dec 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment