## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
CamperBot
@camperbot

hint [6/19]

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Chris Williamson
@williamsonchris
hint
CamperBot
@camperbot

hint [7/19]

## Code Solution:

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Chris Williamson
@williamsonchris
hint
CamperBot
@camperbot

hint [8/19]

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Chris Williamson
@williamsonchris
hint
CamperBot
@camperbot

hint [9/19]

## First solution

function findLongestWord(str) {
var words = str.split(' ');
var maxLength = 0;

for (var i = 0; i < words.length; i++) {
if (words[i].length > maxLength) {
maxLength = words[i].length;
}
}

return maxLength;
}

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Franco Zapata
@Francozt01
hint Seek and Destroy
CamperBot
@camperbot

hint [1/19]

## ## :construction: After this are possible spoiler hints.

Make sure you've tried to hard to solve it yourself before proceeding. :construction:

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Franco Zapata
@Francozt01
hint
CamperBot
@camperbot

hint [2/19]

## # Explanation:

You have to go through each word and figure out which one is the longest and return not the word, but how many characters it has.

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Franco Zapata
@Francozt01
hint
CamperBot
@camperbot

hint [3/19]

## Hint: 1

You should split the string into an array of words.

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Franco Zapata
@Francozt01
hint
CamperBot
@camperbot

hint [4/19]

## Hint: 2

You will need to figure out a way to keep track globally of the greatest current length.

type hint for next hint :pencil: [Contribute at the FCC Wiki]

arielr2017
@arielr2017
hint Assignment with a Returned Value
CamperBot
@camperbot

hint [5/19]

## Hint: 3

Remember how to get the length of elements on the array? Array[index].length

type hint for next hint :pencil: [Contribute at the FCC Wiki]

arielr2017
@arielr2017
hint
CamperBot
@camperbot

hint [6/19]

type hint for next hint :pencil: [Contribute at the FCC Wiki]

arielr2017
@arielr2017
hint
CamperBot
@camperbot

hint [7/19]

## Code Solution:

type hint for next hint :pencil: [Contribute at the FCC Wiki]

arielr2017
@arielr2017
hint
CamperBot
@camperbot

hint [8/19]

type hint for next hint :pencil: [Contribute at the FCC Wiki]

arielr2017
@arielr2017
hint Stand in Line
CamperBot
@camperbot

hint [9/19]

## First solution

function findLongestWord(str) {
var words = str.split(' ');
var maxLength = 0;

for (var i = 0; i < words.length; i++) {
if (words[i].length > maxLength) {
maxLength = words[i].length;
}
}

return maxLength;
}

type hint for next hint :pencil: [Contribute at the FCC Wiki]

fearlessinc
@fearlessinc
hint
CamperBot
@camperbot

hint [1/1]

## ## :construction: After this are possible spoiler hints.

Make sure you've tried to hard to solve it yourself before proceeding. :construction:

type hint for next hint :pencil: [Contribute at the FCC Wiki]

fearlessinc
@fearlessinc
hint
CamperBot
@camperbot
These hints depend on people like you! Please add to this :point_right: Bonfire's Wiki Hints Page
fearlessinc
@fearlessinc
hint
CamperBot
@camperbot

hint [1/1]

## ## :construction: After this are possible spoiler hints.

Make sure you've tried to hard to solve it yourself before proceeding. :construction:

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Luke
@lhovee
hint
CamperBot
@camperbot

hint [1/1]

## ## :construction: After this are possible spoiler hints.

Make sure you've tried to hard to solve it yourself before proceeding. :construction:

type hint for next hint :pencil: [Contribute at the FCC Wiki]

jahson8
@jahson8
hint
CamperBot
@camperbot

hint [1/1]

## ## :construction: After this are possible spoiler hints.

Make sure you've tried to hard to solve it yourself before proceeding. :construction:

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Hello World
CamperBot
@camperbot

hint
CamperBot
@camperbot

hint [1/1]

## ## :construction: After this are possible spoiler hints.

Make sure you've tried to hard to solve it yourself before proceeding. :construction:

type hint for next hint :pencil: [Contribute at the FCC Wiki]

hint[1/1]
hint [1/1]
CamperBot
@camperbot
These hints depend on people like you! Please add to this :point_right: Bonfire's Wiki Hints Page
hint [2/2]
CamperBot
@camperbot
These hints depend on people like you! Please add to this :point_right: Bonfire's Wiki Hints Page
bonfire Find the Longest Word in a String
CamperBot
@camperbot

## :fire:Bonfire: Find the Longest Word in a String :link:

function findLongestWord(str) {
return str.length;
}

findLongestWord('The quick brown fox jumped over the lazy dog');

Return the length of the longest word in the provided sentence.

more info:  bf details | bf links | hint

dsims00
@dsims00
hint
CamperBot
@camperbot

hint [1/1]

## ## :construction: After this are possible spoiler hints.

Make sure you've tried to hard to solve it yourself before proceeding. :construction:

type hint for next hint :pencil: [Contribute at the FCC Wiki]

hendrikof
@hendrikof
hint
Alex Rudzinski
@AlexRudzinski
hint