Skip to content

Instantly share code, notes, and snippets.

@josephdicdican
Last active January 12, 2017 02:13
Show Gist options
  • Save josephdicdican/3e550ae50e170b5e2211d274f9d2412c to your computer and use it in GitHub Desktop.
Save josephdicdican/3e550ae50e170b5e2211d274f9d2412c to your computer and use it in GitHub Desktop.
JS array reduce
"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