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 trialTarek Borhan El-Din
4,229 PointsSomething is wrong in the video
First of all, I am not completely new to programming, I have some basic knowledge.
So, why is there an error when Amit wrote index++ before the println() function? It begins with index[1], but the println function should still be executed because the code gets read from top to bottom.
1 Answer
Angelo Villegas
1,880 PointsActually, it did run. If you can see the console from screenshot, the while loop executed 4 times before giving an error on the 5th iteration.
Tarek Borhan El-Din
4,229 PointsTarek Borhan El-Din
4,229 PointsOh, you're right, didnt notice that. Thank you! :)