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 trialBobbi Jo Bland
7,315 Pointsconsole.log quesion
I don't remember this from the videos...please help.
The following code should print out each item in the array times, but there's one part is missing. Finish the code to log out each array item to the console:
var times = [ 1.22, 1.75, 2.10, 2.55 ]; for (var i=0; i < times.length; i += 1 ) { console.log(times[ ]); }
1 Answer
Marcus Parsons
15,719 PointsHey Bobbi,
You wanna use that "i" variable you create in the for loop because that is what is going over each index in the array. :)