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
Umair Yaquoob
7,500 PointsString
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
7 Answers
Chris Milner
Courses Plus Student 2,141 Points"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.
Umair Yaquoob
7,500 PointsUpdate 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')
Chris Milner
Courses Plus Student 2,141 PointsYou 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.
Umair Yaquoob
7,500 PointsHi,
I doing it like this and it still wrong.
Var quick = quick.indexOf("brown");
Unsubscribed User
5,869 PointsHi, It should be
var indexOfBrown = quick.indexOf("brown");
hope this slows down hair lost symptom.
Ryan Dotson
11,378 PointsThe "O" in ".indexOf" must be capitalized. This is one hung me up also...
Izzatilla Karimov
9,284 Pointsjust add .indexOf("brown") not .indexOf("Brown")
javascript is case sensitive !!!
Jaime Borschuk
6,112 PointsJaime Borschuk
6,112 Points"brown" needs to be lowercase. I did that too.