forked from M3-Academy/challenge-algorithms-v2.0
12 lines
368 B
JavaScript
12 lines
368 B
JavaScript
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 ) ;
|
|
}
|