2022-10-27 15:07:13 +00:00
|
|
|
export function longestWords(words) {
|
2022-11-03 00:45:34 +00:00
|
|
|
let longest = "";
|
|
|
|
|
|
|
|
for (const word of words) {
|
|
|
|
if (word.length > longest.length) {
|
|
|
|
longest = word;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return words.filter((word) => word.length === longest.length);
|
|
|
|
}
|