Answers for "find the longest common prefix in an array of words in javascript"

6

find length of longest string in array javascript

const findLongest = words => Math.max(...(words.map(el => el.length)));

// Example
findLongest(['always','look','on','the','bright','side','of','life']);  // 6
Posted by: Guest on July-02-2020
2

js find longest word in string function

function findLongestWordLength(str) {
  return Math.max(...str.split(' ').map(word => word.length));
}
Posted by: Guest on July-24-2020

Code answers related to "find the longest common prefix in an array of words in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language