Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/JavaScript_Basics/reduce.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ for each value of the array (from left-to-right) and the return
value of the function is stored in an accumulator.

```js
var pokemon = ["Squirtle", "Charmander", "Bulbasaur"];
var pokemon = ["Squirtle", "Charmander", "Bulbasaur"];

var pokeLength = pokemon.reduce(function(previous, current) {
return previous + current.length;
var pokeLength = pokemon.reduce(function(accumulator, current) {
return accumulator + current.length;
}, 0);
```
**Output**
Expand Down