Skip to content
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

Editorial: simplify note for Array.prototype.every #3246

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

zhangenming
Copy link
Contributor

No description provided.

@bakkot
Copy link
Contributor

bakkot commented Dec 22, 2023

This is already covered by the existing text: the condition "callbackfn returned true for all elements" is trivially (vacuously) true for an empty array.

@jmdyck
Copy link
Collaborator

jmdyck commented Dec 22, 2023

I suggest re-titling this PR to "Editorial: Simplify Note for Array.prototype.every".

I don't know, maybe it's reasonable to expect the reader to understand that, with an empty array, any condition "for all elements" is vacuously true. But if we don't have to, why would we? The wording proposed by this PR is correct and is simpler than the status quo.

@zhangenming zhangenming changed the title Editorial: An empty array will also return true. Editorial: Simplify Note for Array.prototype.every. Dec 23, 2023
Copy link
Member

@michaelficarra michaelficarra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 This matches the wording already used in Array.prototype.some.

some calls callbackfn once for each element present in the array, in ascending order, until it finds one where callbackfn returns true. If such an element is found, some immediately returns true. Otherwise, some returns false

@michaelficarra michaelficarra added the ready to merge Editors believe this PR needs no further reviews, and is ready to land. label Feb 15, 2024
@ljharb

This comment was marked as resolved.

@ljharb ljharb marked this pull request as draft February 15, 2024 17:12
@zhangenming

This comment was marked as resolved.

@ljharb ljharb marked this pull request as ready for review February 17, 2024 17:22
@ljharb ljharb changed the title Editorial: Simplify Note for Array.prototype.every. Editorial: simplify note for Array.prototype.every Feb 17, 2024
ljharb pushed a commit to zhangenming/ecma262 that referenced this pull request Feb 17, 2024
@ljharb

This comment was marked as resolved.

@ljharb ljharb marked this pull request as draft February 17, 2024 17:26
@zhangenming

This comment was marked as resolved.

@ljharb

This comment was marked as resolved.

@zhangenming

This comment was marked as resolved.

@ljharb

This comment was marked as resolved.

@zhangenming

This comment was marked as resolved.

@ljharb

This comment was marked as resolved.

@zhangenming

This comment was marked as resolved.

@ljharb
Copy link
Member

ljharb commented Feb 19, 2024

np. Check ~/.gitconfig to make sure your email address is set up properly for future commits.

@ljharb ljharb marked this pull request as ready for review February 19, 2024 06:53
@ljharb ljharb merged commit 80de2f9 into tc39:main Feb 19, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editorial change ready to merge Editors believe this PR needs no further reviews, and is ready to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants