Answers for "find longest string in array using function"

6

Convert longest string in array

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

Code answers related to "find longest string in array using function"

Code answers related to "Javascript"

Browse Popular Code Answers by Language