Merge pull request #2487 from lumosmind/patch-4

conflict with "rest syntax"
This commit is contained in:
Ilya Kantor 2021-02-02 10:31:05 +03:00 committed by GitHub
commit e825d256a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,7 +5,7 @@ There's another very simple and concise syntax for creating functions, that's of
It's called "arrow functions", because it looks like this:
```js
let func = (arg1, arg2, ...argN) => expression
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.
@ -13,7 +13,7 @@ let func = (arg1, arg2, ...argN) => expression
In other words, it's the shorter version of:
```js
let func = function(arg1, arg2, ...argN) {
let func = function(arg1, arg2, ..., argN) {
return expression;
};
```