Skip to content

Commit 886a62d

Browse files
authored
Merge pull request #1208 from upbeatcode/master
update article.md
2 parents af3a544 + 38e1937 commit 886a62d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

1-js/02-first-steps/14-function-basics/article.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,17 @@ That doesn't work, because JavaScript assumes a semicolon after `return`. That'l
338338
return*!*;*/!*
339339
(some + long + expression + or + whatever * f(a) + f(b))
340340
```
341-
So, it effectively becomes an empty return. We should put the value on the same line instead.
341+
So, it effectively becomes an empty return.
342+
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:
343+
344+
```js
345+
return (
346+
some + long + expression
347+
+ or +
348+
whatever * f(a) + f(b)
349+
)
350+
```
351+
And it will work just as we expect it to.
342352
````
343353
344354
## Naming a function [#function-naming]

0 commit comments

Comments
 (0)