Skip to content

Instantly share code, notes, and snippets.

@jonschlinkert
Created June 13, 2018 14:49
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonschlinkert/4af7e1da8e0e2e7cf61b6335640d443d to your computer and use it in GitHub Desktop.
Save jonschlinkert/4af7e1da8e0e2e7cf61b6335640d443d to your computer and use it in GitHub Desktop.
Get the length of the longest item in an array of strings.
const longest = arr => arr.reduce((len, v) => Math.max(v.length, len), 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment