feat: resolve longestWords

This commit is contained in:
Naian Felix dos Santos 2022-10-28 10:51:39 -03:00
parent d68e3bd4d9
commit 9efc455565

View File

@ -1,4 +1,18 @@
export function longestWords(words) {
// implementar logica aqui
let big = "";
words.forEach(word => {
if(word.length > big.length){
big = word
}
});
const result = words.filter(word => {
if(word.length === big.length){
return word
}
});
return result
}