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 trialBrendan Passey
999 PointsAt this point do we need promptForGuess to return a boolean?
I was going through my code and realised that at this point returning the boolean isHit from promptForGuess doesn't do anything. I imagine we needed it in the past before we set it up to call the applyGuessMethod.
I've made it a void method and taken out the return line and it seems to work fine, am I missing something?
1 Answer
Steven Parker
231,271 PointsYou're right, since the return value is being ignored it make no difference if the function has a return or not. Disregarding the return is perfectly safe, though, so converting the function is purely optional.
ygh5254e69hy5h545uj56592yh5j94595682hy95
7,934 Pointsygh5254e69hy5h545uj56592yh5j94595682hy95
7,934 PointsCould you post your code here?