Answers for "javascript how to get longest value in an array"

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
0

javascript find the longest string in array

Math.max(...(x.map(el => el.length)));
Posted by: Guest on October-02-2020

Code answers related to "javascript how to get longest value in an array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language