update article.md
This commit is contained in:
parent
a894b9e278
commit
38e1937a88
1 changed files with 11 additions and 1 deletions
|
@ -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]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue