This commit is contained in:
joaquinelio 2022-03-31 11:54:53 -03:00 committed by GitHub
parent 63ca152205
commit b1607f5378
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -78,7 +78,7 @@ They are very convenient for simple one-line actions, when we're just too lazy t
The arrow functions that we've seen so far were very simple. They took arguments from the left of `=>`, evaluated and returned the right-side expression with them. The arrow functions that we've seen so far were very simple. They took arguments from the left of `=>`, evaluated and returned the right-side expression with them.
Sometimes we need a more complex function, with multiple expressions and statements. In that case, but we can enclose them in curly braces. The major difference is that curly braces require a `return` within them to return a value (just like a regular function does). Sometimes we need a more complex function, with multiple expressions and statements. In that case, we can enclose them in curly braces. The major difference is that curly braces require a `return` within them to return a value (just like a regular function does).
Like this: Like this: