Longest word - espero les sirva

import { subsequences, stringSequence } from ‘subsequence.words’;
function longestWord(array) {
let longestWord = ‘’;
for (var element of array) {
longestWord.length;
if (element.length > longestWord.length) {
longestWord = element;
}
}
return longestWord;
};
console.log(stringSequence);
console.log(subsequences);
console.log(longestWord(subsequences));

import { subsequences, stringSequence } from ‘subsequence.words’;
function longestWord(array) {
let longestWord = ‘’;
for (let i = 0; i < array.length; i++) {
array[i].length;
if (array[i].length > longestWord.length) {
longestWord = array[i];
}
}
return longestWord;
};
console.log(stringSequence);
console.log(subsequences);
console.log(longestWord(subsequences));

4 Likes

hola, si me sirvió, muchas gracias

1 Like

@Alejandro_Martinez_L ,Hermano eres el mejor me ayudo demasiado,muchas gracias de verdad

1 Like

Respuesta de la Aplicación: Salida interior