Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ecf8e07

Browse files
Remove unnecessary variables
1 parent bd3ba6e commit ecf8e07

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,14 +405,12 @@ Other Style Guides
405405
[1, 2, 3].map(x => x + 1);
406406
407407
// bad - no returned value means `memo` becomes undefined after the first iteration
408-
const flat = {};
409408
[[0, 1], [2, 3], [4, 5]].reduce((memo, item, index) => {
410409
const flatten = memo.concat(item);
411410
memo[index] = flatten;
412411
});
413412
414413
// good
415-
const flat = {};
416414
[[0, 1], [2, 3], [4, 5]].reduce((memo, item, index) => {
417415
const flatten = memo.concat(item);
418416
memo[index] = flatten;

0 commit comments

Comments
 (0)