Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ugultopu/35bb00a7fc8d1e18a78c51e1470663b8 to your computer and use it in GitHub Desktop.
Save ugultopu/35bb00a7fc8d1e18a78c51e1470663b8 to your computer and use it in GitHub Desktop.
strings.reduce(
(max, string) => string.length > max ? string.length : max,
0
);
// Or, more verbose version:
strings.reduce(
(max, string) => {
if (string.length > max) return string.length;
else return max;
},
0
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment