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!
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
Nathaniel Quashie4,376 Points
[Coding Challenge help] Update the variable of 'tenthCharacter' on about line 20, to get the tenth character ....
So basically its asking for the 10th character in the string assigned to the variable quick. Seeing as JS starts its count from 0, you'd think the answer would be "b" or quick.charAt(10)
but instead if you try that it'll show an error saying they expected an empty string or " " as the answer... but the " " is located at the 9th index...
I have the right answer, I just wanted to bring this (possible bug?) to the attention of teachers as this could be a confusing error for complete noobies.
Maciej Czuchnowski36,441 Points
Well, the right answer is definitely
var tenthCharacter = quick.charAt(9);, since index 9 is the 10th character and it is ' '. Space is the 10th character (from natural, intuitive human perspective), but human 10th character is indexed as 9 in most programming languages.