Skip to content

Instantly share code, notes, and snippets.

@newtomsoft
Last active June 28, 2020 01:47
Show Gist options
  • Select an option

  • Save newtomsoft/d1605e6fc681305e89599273c7cafb5e to your computer and use it in GitHub Desktop.

Select an option

Save newtomsoft/d1605e6fc681305e89599273c7cafb5e to your computer and use it in GitHub Desktop.
function allLongestStrings(array) {
let lengthMax = 0;
array.forEach(word => lengthMax = word.length > lengthMax ? word.length : lengthMax);
return array.filter(word => word.length == lengthMax);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment