From 2380c0ddb849c61d61db92331cc0255f2c68c02b Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 27 Sep 2017 12:51:40 -0700 Subject: [PATCH] [guide] Improve severity of warning comment --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ffa841039b..f0186becac 100644 --- a/README.md +++ b/README.md @@ -381,10 +381,10 @@ Other Style Guides ```javascript // bad - const bar = [...foo].map(bar); + const baz = [...foo].map(bar); // good - const bar = Array.from(foo, bar); + const baz = Array.from(foo, bar); ``` @@ -400,18 +400,18 @@ Other Style Guides // good [1, 2, 3].map(x => x + 1); - // bad + // bad - no returned value means `memo` becomes undefined after the first iteration const flat = {}; [[0, 1], [2, 3], [4, 5]].reduce((memo, item, index) => { const flatten = memo.concat(item); - flat[index] = flatten; + memo[index] = flatten; }); // good const flat = {}; [[0, 1], [2, 3], [4, 5]].reduce((memo, item, index) => { const flatten = memo.concat(item); - flat[index] = flatten; + memo[index] = flatten; return flatten; });