feat(longestWords): Responde função 10

This commit is contained in:
Affonso Kopmann 2022-10-30 15:53:45 -03:00
parent 083a8e14a8
commit ecb4e8b483

View File

@ -2,4 +2,10 @@ import { arrayBuffer } from "stream/consumers";
export function longestWords(words) {
// implementar logica aqui
let maioresPalavras = "";
for ( const word of words ) {
if ( word.length > maioresPalavras.length ) {
maioresPalavras = word; }
}
return words.filter ( ( word ) => word.length == maioresPalavras.length ) ;
}