File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -659,7 +659,7 @@ class SuperArray extends Array {
659
659
660
660
### Favor functional programming over imperative programming
661
661
JavaScript isn't a functional language in the way that Haskell is, but it has
662
- a functional flavor to it. Functional languages are cleaner and easier to test.
662
+ a functional flavor to it. Functional languages can be cleaner and easier to test.
663
663
Favor this style of programming when you can.
664
664
665
665
** Bad:**
@@ -705,10 +705,9 @@ const programmerOutput = [
705
705
}
706
706
];
707
707
708
- const INITIAL_VALUE = 0 ;
709
-
710
708
const totalOutput = programmerOutput
711
- .reduce ((acc , { linesOfCode }) => acc + linesOfCode, INITIAL_VALUE );
709
+ .map (output => output .linesOfCode )
710
+ .reduce ((totalLines , lines ) => totalLines + lines);
712
711
```
713
712
** [ ⬆ back to top] ( #table-of-contents ) **
714
713
You can’t perform that action at this time.
0 commit comments