Skip to content

Commit

Permalink
Update reduce.js
Browse files Browse the repository at this point in the history
  • Loading branch information
thibmaek authored Aug 16, 2016
1 parent ecf6fdf commit 66189f1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions JavaScript/Built-In Objects/Array/reduce.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

let arr = [1, 2, 3, 4];

console.log(typeof arr, arr);
// 📋 object [1, 2, 3, 4]
console.log(arr);
// 📋 [1, 2, 3, 4]

arr = arr.reduce((prev, curr) => prev + curr);

console.log(typeof arr, arr);
// 📋 number 10
console.log(arr);
// 📋 10

0 comments on commit 66189f1

Please sign in to comment.