Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Mehran Amini Tehrani
1,523 PointsArray
Hello,
How can I print out the number of items in the todo array using println? I know for counting I need to write for example: todo. count, but it does not work.
var todo = ["Learn Swift", "Build App", "Deploy App"]
todo. count
4 Answers

eirikvaa
18,015 PointsHere's a link.

eirikvaa
18,015 PointsThe println function prints the value as a string.
var todo = ["Learn Swift", "Build App", "Deploy App"]
println(todo.count)
Remember that the ebook "The Swift Programming Language" by Apple is a great (and free) resource on Swift, and you can learn a lot just by skimming through the first chapter.

Mehran Amini Tehrani
1,523 PointsThanks for your response... How can I get that book?

Mehran Amini Tehrani
1,523 PointsI've got it Erik. Thank you very much

eirikvaa
18,015 PointsGreat!