arr.reduce((a, b)=> a.length > b.length ? a : b);
function solution(inputArray) {
return inputArray.reduce((r, s, i) => {
if (!i || r[0].length < s.length) {
return [s];
}
if (r[0].length === s.length) {
r.push(s);
}
return r;
}, []);
}
Math.max(...(x.map(el => el.length)));
function longestWordLength(str) {
return Math.max(...str.split(' ').map(word => word.length));
}