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 trialameerm
Full Stack JavaScript Techdegree Graduate 14,976 PointsThe following code should print out each item in the array times, but there's one part missing. Finish the code to log o
help please not sure what to put here var times = [ 1.22, 1.75, 2.10, 2.55 ]; for (var i=0; i < times.length; i += 1 ) { console.log(times[]); }
1 Answer
Jamie Reardon
Treehouse Project ReviewerYou are very close! You need to enter the variable i inside of the brackets of the console.log output. You are looking to access the items in the array, and you would do so using bracket notation. Since you want to output all the items it is based to use a loop for this. Therefore it is fortunately convientant to use the index/counter variable to do this!