Skip to content

Commit 2aedc2d

Browse files
committed
refactor arrow functions
1 parent 6165a9a commit 2aedc2d

File tree

1 file changed

+6
-2
lines changed
  • 1-js/02-first-steps/16-arrow-functions-basics

1 file changed

+6
-2
lines changed

Diff for: 1-js/02-first-steps/16-arrow-functions-basics/article.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,19 @@ Like this:
8686
let sum = (a, b) => { // the curly brace opens a multiline function
8787
let result = a + b;
8888
*!*
89-
return result; // if we use curly braces, use return to get results
89+
return result; // if we use curly braces, then we need an explicit "return"
9090
*/!*
9191
};
9292
9393
alert( sum(1, 2) ); // 3
9494
```
9595
9696
```smart header="More to come"
97-
Here we praised arrow functions for brevity. But that's not all! Arrow functions have other interesting features. We'll return to them later in the chapter <info:arrow-functions>.
97+
Here we praised arrow functions for brevity. But that's not all!
98+
99+
Arrow functions have other interesting features.
100+
101+
To study them in-depth, we first need to get to know some other aspects of JavaScript, so we'll return to arrow functions later in the chapter <info:arrow-functions>.
98102
99103
For now, we can already use arrow functions for one-line actions and callbacks.
100104
```

0 commit comments

Comments
 (0)