Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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")