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 trialDavid Sheppeard
Courses Plus Student 550 Pointshow to call 'count' on an array
i am having trouble printing out the number of items in my array with the todo.count.
var todo = ["Learn Swift", "Build App", "Deploy App"]
println = todo.count
1 Answer
John Wilson
12,845 PointsHere is the answer! Just small formatting change :-)
var todo = ["Learn Swift", "Build App", "Deploy App"]
println(todo.count)
Caleb Kleveter
Treehouse Moderator 37,862 PointsCaleb Kleveter
Treehouse Moderator 37,862 PointsJohn Wilson , I thought I might let you know I changed your comment to an answer. This allows you to be up-voted, and awarded with best answer!
David Sheppeard
Courses Plus Student 550 PointsDavid Sheppeard
Courses Plus Student 550 Pointscheers John, it was late last night here in OZ and it was doing my head in :)
John Wilson
12,845 PointsJohn Wilson
12,845 PointsThank you Caleb! Cheers guys.