en.javascript.info icon indicating copy to clipboard operation
en.javascript.info copied to clipboard

Improved arrow function arguments example

Open jaskirank1 opened this issue 5 months ago • 1 comments

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.

jaskirank1 avatar Aug 11 '25 10:08 jaskirank1

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Aug 11 '25 10:08 CLAassistant