Last active
January 12, 2017 02:13
-
-
Save josephdicdican/3e550ae50e170b5e2211d274f9d2412c to your computer and use it in GitHub Desktop.
JS array reduce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
const arr = [ 1, 2, 3, 4, 5]; | |
let max = arr.reduce((a, b) => { | |
return a > b ? a : b; | |
}, 0); | |
console.log(max); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment