From b54ce438c8e590ae25154277d69a802d247a28d1 Mon Sep 17 00:00:00 2001 From: Tomek Wiszniewski Date: Wed, 2 Dec 2015 11:58:01 +0100 Subject: [PATCH] Clarify 8.4 --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a99558ec..73ed24fc 100644 --- a/README.md +++ b/README.md @@ -743,7 +743,7 @@ Other Style Guides ``` - - [8.4](#8.4) If your function takes a single argument and consists of a single expression, omit the parentheses. + - [8.4](#8.4) If your function takes a single argument and doesn’t use braces, omit the parentheses. > Why? Less visual clutter. @@ -756,6 +756,12 @@ Other Style Guides // good [1, 2, 3].map(x => x * x); + // good + [1, 2, 3].map(number => ( + `A long string with the ${number}. It’s so long that we’ve broken it ` + + 'over multiple lines!' + )); + // bad [1, 2, 3].reduce(x => { const y = x + 1;