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
Chris Rubio
1,643 PointsI am confused, why on min 6:17 does he write hits = " " ;and misses =" " ; ??? i dont get it why are they blank ?
please could someone explain this step , im not understading the purpose for this step
Chris Rubio
1,643 Points1 Answer
Ben Reynolds
35,170 PointsHe's initializing the two variables to be empty strings when the game starts. Later, in the applyGuess method, he appends the player's hits and misses to those strings, but that wouldn't work unless the variables had some initial value. Even if it's just an empty string, it still has to exist before it can be appended to.
Chris Rubio
1,643 PointsGREAT that make sense . THANK YOU :)
Ben Reynolds
35,170 PointsBen Reynolds
35,170 PointsNot sure which lesson you mean, can you post a link?