From 417f9896d0ae1088aafbc5c223ca3596cb9f4811 Mon Sep 17 00:00:00 2001 From: Tomek Wiszniewski Date: Thu, 13 Aug 2015 08:47:48 +0200 Subject: [PATCH] Bring back explicit return in 8.1 example --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3b1bba85..724a4dea 100644 --- a/README.md +++ b/README.md @@ -593,11 +593,15 @@ ```javascript // bad [1, 2, 3].map(function (x) { - return x * x; + const y = x + 1; + return x * y; }); // good - [1, 2, 3].map(x => x * x); + [1, 2, 3].map((x) => { + const y = x + 1; + return x * y; + }); ``` - [8.2](#8.2) If the function body consists of a single expression, feel free to omit the braces and use the implicit return. Otherwise use a `return` statement.