minor fixes
This commit is contained in:
parent
bd0921bd85
commit
34ab022835
1 changed files with 2 additions and 2 deletions
|
@ -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"
|
||||
*/!*
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue