<Feture>(10-logestWords): implementação do código logestWords

This commit is contained in:
Gabriel Ferraz Nogueira 2022-10-31 14:28:42 -03:00
parent 985af27572
commit 15b475e964

View File

@ -1,4 +1,10 @@
export function longestWords(words) {
// implementar logica aqui
let longestSize = 0
let longestWord = []
words.forEach(element => {
if(element.length>longestSize)
{longestSize = element.length}})
longestWord = words.filter(element => element.length === longestSize);
return longestWord
}