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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions 1-js/06-advanced-functions/02-rest-parameters-spread/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,17 @@ If we access the `arguments` object from an arrow function, it takes them from t
Here's an example:

```js run
function f() {
let showArg = () => alert(arguments[0]);
showArg();
function f(){

alert(arguments[0]);
let arrow = msg => {
alert(msg);
alert(arguments[0]); // arguments stores all the arguments passed to a function so this arguments must store the parameters that are passed while calling arrow function right?
}
arrow(arguments[1]);
}

f(1); // 1
f(1, "Hii"); // 1 Hii 1
```

As we remember, arrow functions don't have their own `this`. Now we know they don't have the special `arguments` object either.
Expand Down