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 Challeng task 4 of 6

Questions is Update the variable of 'wordBrown' on about line 21, to extract the substring of "brown" from the string 'quick'. I can't seem get this one correct.

The error I'm getting is : Bummer! Was expecting the string of 'brown' but got ' brown ' (I believe is the right answer)

var quick = "The quick brown fox jumps over the lazy dog"; var wordBrown = quick.substr(9, 7); I also ran this using a console.log(wordBrown); and I received the correct answer.

Please advise

Thanks

2 Answers

Thanks Nick: But I got this error

Bummer! Was expecting the string of 'brown' but got ' brow'

Could this question be bugged?

Try this then:

var wordBrown = quick.substr(10, 5)

Does this work?

Thanks Miriam,

Your fix worked like a charm.

Have a great week.

Great! Have a nice week you too ;)

You have too many spaces around ' brown ', try:

var wordBrown = quick.substr(9, 5);