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
Update title and text from rest parameter to rest property (or element) #47473
Comments
Just so I don't forget if it is changed the hint guide needs to be updated as well. |
I'm honestly tempted to just change this to |
I assume you mean rest and not spread? Because in the context of the challenge it is rest. The least specific verbiage would be "rest syntax", which would cover "rest parameter", "rest property", and "rest element". I'm also not convinced Even though I came to the conclusion independently by reading the specs that it is a "rest element" I now have more confidence that it is in fact the correct term (rest element).
|
I agree that the wording isn't correct.
And so in that case, where it is collecting the rest of the array, it is certainly rest. And it is not an operator because it does not operate on array, as spread does. In that case, If you use it in the right side, would become spread though XD Rest property sounds good to me. |
I just noticed that the challenge already calls it a "rest element"
Here is a suggested change, I only changed the title and changed "rest parameter" to "rest syntax". Destructuring via rest elementsIn some situations involving array destructuring, we might want to collect the rest of the elements into a separate array. The result is similar to
Variables Use destructuring assignment with the rest syntax to perform an effective |
I added the first timers label. Lets go with @lasjorg's suggestion in the comment above this.
|
Hi there, I am completely new to the open source culture and i would want to make this contribution. |
An issue with the help wanted or first timers only label is open for contribution. The first comprehensive PR created will be reviewed and merged. If have not read the contributors docs then I would suggest reading that first If you have any issues with contributing, be sure to join us on the contributors channel, or on the contributors sub-forum |
Since @roygav has already committed changes, i can't commit these changes right? |
Describe the Issue
A rest parameter would involve parameters.
The MDN article on rest parameter only has function parameter examples and it links to the function definition part of the specs. The only instance I can find of the words "rest parameter" in the specs is under the Parameter Lists section.
MDN calls it a rest property when
...rest
is used with a destructuring assignment.The specs do seem to have two versions of it if I read it correctly, the
AssignmentRestElement
used with arrays and theAssignmentRestProperty
used with objects.13.15.5.2 Runtime Semantics: DestructuringAssignmentEvaluation
While "rest element" might be more correct with an array I don't think using "rest property" for both arrays and objects as MDN does is the end of the world.
Affected Page
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements
Your code
Expected behavior
The correct technical definition should be used.
Screenshots
No response
System
Additional context
This PR #35496 changed it from rest operator to rest parameter.
The text was updated successfully, but these errors were encountered: