This commit is contained in:
Ilya Kantor 2019-08-06 09:50:01 +03:00
parent fc66b43ce3
commit b7a0591007
3 changed files with 8 additions and 18 deletions

View file

@ -248,8 +248,6 @@ We covered three ways to create a function in JavaScript:
};
```
Function expressions can have a name, like `sum = function name(a, b)`, but that `name` is only visible inside that function.
3. Arrow functions:
```js
@ -274,13 +272,7 @@ We covered three ways to create a function in JavaScript:
- Parameters can have default values: `function sum(a = 1, b = 2) {...}`.
- Functions always return something. If there's no `return` statement, then the result is `undefined`.
| Function Declaration | Function Expression |
|----------------------|---------------------|
| visible in the whole code block/script | created when the execution reaches it |
| | can have a name, visible only inside the function |
More: see <info:function-basics>, <info:function-expressions-arrows>.
Details: see <info:function-basics>, <info:function-expressions-arrows>.
## More to come