minor fixes

This commit is contained in:
Ilya Kantor 2022-01-21 13:52:32 +03:00
parent bd0921bd85
commit 34ab022835

View file

@ -33,7 +33,7 @@ let sum = function(a, b) {
alert( sum(1, 2) ); // 3
```
As you can, see `(a, b) => a + b` means a function that accepts two arguments 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 that accepts two arguments named `a` and `b`. Upon the execution, it evaluates the expression `a + b` and returns the result.
- If we have only one argument, then parentheses around parameters can be omitted, making that even shorter.
@ -86,7 +86,7 @@ Like this:
let sum = (a, b) => { // the curly brace opens a multiline function
let result = a + b;
*!*
return result; // if we use curly braces, then we need an explicit "return"
return result; // if we use curly braces, then we need an explicit "return"
*/!*
};