Basic Algorithm Scripting (4/16) | Find the Longest Word in a String | freeCodeCamp

preview_player
Показать описание
Basic Algorithm Scripting (4/16) | Find the Longest Word in a String | freeCodeCamp
Рекомендации по теме
Комментарии
Автор

Thank you so much this lesson has been changed and or updated which is why my original answer didn't work
function findLongestWordLength(str) {
// return str.length;
return Math.max(...str
.split(" ")
.map(text => text.length))
}

findLongestWordLength("The quick brown fox jumped over the lazy dog");

zken
welcome to shbcf.ru