Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

String

Update the variable of 'indexOfBrown' on about line 19, to find the index of the string of "brown" in the string 'quick'

my answer: var indexOfBrown = quick.indexOf("Brown");

it's wrong i'm confused

"brown" needs to be lowercase. I did that too.

7 Answers

"brown" doesn't exist in the string "quick". The index returned would be -1 (or false via a test)

If it does, what does quick equal? Could it be case sensitive.

Update the variable of 'indexOfBrown' on about line 19, to find the index of the string of "brown" in the string 'quick'.

var quick = "The quick brown fox jumps over the lazy dog".length;

      var quickLength    = quick;
      var indexOfBrown = quick;
      var tenthCharacter = quick;
      var wordBrown = quick;
      var quickUpper = quick;
      var quickLower = quick;

I'm stuck have no idea I taught it is indexOf('brown')

You are right it is indexOf (quick.indexOf("brown)) - your variable quick still won't equal that sentence though because of ".length" on the end of it. var quick will equal a number, the number of characters in the sentence. Remove .length from the end of the sentence, and make var quick, look like this:

var quick = "The quick brown fox jumps over the lazy dog";

Now quick.indexOf("brown") will return the index of the word brown.

I hope this helps.

Chris.

Hi,

I doing it like this and it still wrong.

Var quick = quick.indexOf("brown");

Hi, It should be

var indexOfBrown = quick.indexOf("brown");

hope this slows down hair lost symptom.

The "O" in ".indexOf" must be capitalized. This is one hung me up also...

just add .indexOf("brown") not .indexOf("Brown")

javascript is case sensitive !!!