Skip to content

Instantly share code, notes, and snippets.

@piqueen314 piqueen314/gist3
Created Dec 11, 2015

What would you like to do?
Return the length of the longest word in the provided sentence.
// Bonfire: Find the Longest Word in a String
// Author: @piqueen314
// Challenge:
// Learn to Code at Free Code Camp (
function findLongestWord(str) {
var words=str.split(" ");
var max=0;
for (var i=0; i < words.length; i++)
return max;
findLongestWord("The quick brown fox jumped over the lazy dog");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.