1const findLongest = words => Math.max(...(words.map(el => el.length)));
2
3// Example
4findLongest(['always','look','on','the','bright','side','of','life']); // 6
1 function data(str){
2 var show = str.split(" ");
3 show.sort(function (a,b){
4 return b.length - a.length;
5 })
6 return show[0];
7 }
8 console.log(data(str = "javascript is my favourite language "));