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 JavaScript Foundations Strings Methods

Molly Bar
PLUS
Molly Bar
Courses Plus Student 5,925 Points

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

My answer was:

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

why was this wrong? I read the forum and found the if I type "brown" instead of "Brown", it works. I hate this kind of glitches. I wish the instructor said something about upper case and lower case letters.

4 Answers

Well Javascript in general is case sensitive so this is good practice. When you would declare "indexOfBrown" as "IndexOfBrown" you woulndn't be able to use it with a lowercase. Also when you are looking for "brown" you just shouldn't search for "Brown"

Molly Bar
PLUS
Molly Bar
Courses Plus Student 5,925 Points

I am not the only one had this problem. I think if the instructor made it clear, we all would've got this right on first try. It's very upsetting. He prints out everything in console.log but never showed how to update or get this and that like how they actually ask the question. It takes us a while to figure out what it means and get to the answer, it's a guessing game. There's a huge disconnect between how he is teaching and how the questions are being asked. I am so frustrated over this and it's slowing me down.:(

For some reason when I did it, i just took out the semi colon at the end of the variable decoration and it worked. That doesn't seem accurate.

var indexOfBrown = quick.indexOf("Brown")