Merge pull request #1208 from upbeatcode/master

update article.md
This commit is contained in:
Ilya Kantor 2019-08-03 08:53:51 +03:00 committed by GitHub
commit 886a62d1ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -338,7 +338,17 @@ That doesn't work, because JavaScript assumes a semicolon after `return`. That'l
return*!*;*/!* return*!*;*/!*
(some + long + expression + or + whatever * f(a) + f(b)) (some + long + expression + or + whatever * f(a) + f(b))
``` ```
So, it effectively becomes an empty return. We should put the value on the same line instead. So, it effectively becomes an empty return.
If we wanted our expression to wrap across multiple lines, we would have to put the opening parenthesis in the same line as the `return` statement as follows:
```js
return (
some + long + expression
+ or +
whatever * f(a) + f(b)
)
```
And it will work just as we expect it to.
```` ````
## Naming a function [#function-naming] ## Naming a function [#function-naming]