retourner la plus longue chaîne du tableau
arr.reduce((a, b)=> a.length > b.length ? a : b);
Shirshak kandel
arr.reduce((a, b)=> a.length > b.length ? a : b);
function data(str){
var show = str.split(" ");
show.sort(function (a,b){
return b.length - a.length;
})
return show[0];
}
console.log(data(str = "javascript is my favourite language "));
Math.max(...(x.map(el => el.length)));