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.