Created
March 20, 2017 16:58
-
-
Save lubien/6c53a80b466f44371c12c477f562a3c8 to your computer and use it in GitHub Desktop.
Find the max number in an array using 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
const max = (x, y) => x > y ? x : y | |
console.log([1, 2, 3, 4, 5, 6].reduce(max)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment