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 trialMehran 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!