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 trialRebecca Palumbo
5,506 PointsUsed a for loop and array
Just thought I'd post what I did if anyone wanted to see how to do it with a for loop and an array.
Leaders or pros - let me know if there's a better way to do this or if there is anything that is not a best practice. Thanks!
3 Answers
Rebecca Palumbo
5,506 PointsBecause we were supposed to let the user know how many questions were left and I used the variable in the for loop to let the user know, which was decreasing.
Piotr Manczak
Front End Web Development Techdegree Graduate 29,324 PointsWhy did you use for loop that decreases? For fun?
Piotr Manczak
Front End Web Development Techdegree Graduate 29,324 PointsI would do it using increasing q but your way is quite interesting. As long as it works it's cool. Very refreshing approach. I have to remember that solution, it may be very useful in the future.