Created
June 13, 2018 14:49
-
-
Save jonschlinkert/4af7e1da8e0e2e7cf61b6335640d443d to your computer and use it in GitHub Desktop.
Get the length of the longest item in an array of strings.
This file contains hidden or 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 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