Change the second argument deleteCount of Array.prototype.toSpliced to skipCount. #38805
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I changed all instances of deleteCount to skipCount in the documentation for toSpliced.
Motivation
In the first place, the ECMA-262 specification for toSpliced actually uses skipCount, not deleteCount.
The word “delete” implies mutation, which is why it was likely avoided. (tc39/ecma262#2997 (comment))
To align with the ECMA spec, and because “skip” is semantically more accurate than “delete” in this context, I believe it would be better to update it.
Additional details
Also, it seems that the term deleteCount was used during the initial proposal stage of this method.
(https://github.com/tc39/proposal-change-array-by-copy?tab=readme-ov-file#overview)
Related issues and pull requests