From 38e1937a88152a10eb05bc05372941826f7470cc Mon Sep 17 00:00:00 2001 From: Ahmed Bouhamra Date: Sat, 3 Aug 2019 01:39:03 +0000 Subject: [PATCH] update article.md --- 1-js/02-first-steps/14-function-basics/article.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/1-js/02-first-steps/14-function-basics/article.md b/1-js/02-first-steps/14-function-basics/article.md index 7afc30b2..6684f60d 100644 --- a/1-js/02-first-steps/14-function-basics/article.md +++ b/1-js/02-first-steps/14-function-basics/article.md @@ -338,7 +338,17 @@ That doesn't work, because JavaScript assumes a semicolon after `return`. That'l return*!*;*/!* (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]