feat(10-longestWords): Cria a função

This commit is contained in:
Leonardo Pereira Rocha 2022-11-02 17:14:55 -03:00
parent d2ea761b4f
commit d11374eae2

View File

@ -1,4 +1,10 @@
export function longestWords(words) {
// implementar logica aqui
let longWord = "";
let word;
for(word of words) {
if (word.length > longWord.length){
longWord = word;
}
}
return words.filter((word) => word.length === longWord.length);
}