Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

replace args by params fix issue #3849#3850

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
joaquinelio wants to merge1 commit intojavascript-tutorial:master
base:master
Choose a base branch
Loading
fromjoaquinelio:arrowargfix
Open
Changes fromall 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
8 changes: 4 additions & 4 deletions1-js/02-first-steps/17-arrow-functions-basics/article.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@ It's called "arrow functions", because it looks like this:
let func = (arg1, arg2, ..., argN) => expression;
```

This creates a function `func`that accepts arguments `arg1..argN`, then evaluates the `expression` on the right side with their use and returns its result.
This creates a function `func`with parameters `arg1..argN`, then evaluates the `expression` on the right side with their use and returns its result.

In other words, it's the shorter version of:

Expand All@@ -33,9 +33,9 @@ let sum = function(a, b) {
alert( sum(1, 2) ); // 3
```

As you can see, `(a, b) => a + b` means a function thataccepts twoarguments named `a` and `b`. Upon the execution, it evaluates the expression `a + b` and returns the result.
As you can see, `(a, b) => a + b` means a function thatdefines twoparameters named `a` and `b`. Upon the execution, it evaluates the expression `a + b` and returns the result.

- If we have only oneargument, then parentheses aroundparameters can be omitted, making that even shorter.
- If we have only oneparameter, then parentheses aroundit can be omitted, making that even shorter.

For example:

Expand All@@ -48,7 +48,7 @@ As you can see, `(a, b) => a + b` means a function that accepts two arguments na
alert( double(3) ); // 6
```

- If there are noarguments, parentheses are empty, but they must be present:
- If there are noparameters, parentheses are empty, but they must be present:

```js run
let sayHi = () => alert("Hello!");
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp