Skip to content

Improved arrow function arguments example #3868

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jaskirank1
Copy link

The updated example better demonstrates how arguments behaves inside arrow functions. In the previous example, the arrow function was invoked without passing its own parameters, so it wasn’t obvious that arguments inside an arrow function refers to the arguments of the outer normal function.

In the new example, we explicitly pass a parameter ("Hii") to the arrow function, and also log arguments[0] inside it. This makes it clear that arguments[0] is still taken from the outer function (1) and not from the arrow function’s own parameter list, illustrating the lexical binding behavior of arguments in arrow functions.

Improved arrow function "arguments" example in rest/spread parameters article
@javascript-translate-bot javascript-translate-bot added review needed Review needed, please approve or request changes labels Aug 11, 2025
@javascript-translate-bot javascript-translate-bot requested a review from a team August 11, 2025 10:52
@CLAassistant
Copy link

CLAassistant commented Aug 11, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review needed Review needed, please approve or request changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants