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
Jeffrey Vierra
25,404 PointsJavaScript 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
Jeffrey Vierra
25,404 PointsThanks Nick: But I got this error
Bummer! Was expecting the string of 'brown' but got ' brow'
Could this question be bugged?
Nina Patkai
858 PointsYou have too many spaces around ' brown ', try:
var wordBrown = quick.substr(9, 5);
Miriam Tocino
14,201 PointsMiriam Tocino
14,201 PointsTry this then:
var wordBrown = quick.substr(10, 5)Does this work?
Jeffrey Vierra
25,404 PointsJeffrey Vierra
25,404 PointsThanks Miriam,
Your fix worked like a charm.
Have a great week.
Miriam Tocino
14,201 PointsMiriam Tocino
14,201 PointsGreat! Have a nice week you too ;)