Tell us what’s happening:
made it work in visual code… i don’t understand why i wont pass the test… any help please… thank you for reading…
Your code so far
function findLongestWord(str) {
strSplit = str.split(' ');
strNum = [];
strSplit.forEach(function(item){strNum.push(item.length);});
console.log(strNum.reduce(function(a,b){return Math.max(a,b);}));
}
findLongestWord("The quick brown fox jumped over the lazy dog");
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36
.
Link to the challenge: