Skip to content

Instantly share code, notes, and snippets.

@droid001
Created January 25, 2018 13:39
Show Gist options
  • Save droid001/00f01381e72f7aab3ef63f293a4b5652 to your computer and use it in GitHub Desktop.
Save droid001/00f01381e72f7aab3ef63f293a4b5652 to your computer and use it in GitHub Desktop.
Largest number in array using .reduce
return arr.reduce(function(acc, curr) {
return acc > curr ? acc : curr;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment