find length of longest string in array javascript
snippet in javascript

find length of longest string in array javascript

user5000

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

// Example
findLongest(['always','look','on','the','bright','side','of','life']);  // 6