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 trial

iOS Swift Basics (retired) Collections What is an Array?

unsure what i'm doing wrong

Im just unsure what I'm doing wrong.

var todo: [String] = ["Learn Swift","Build App","Deploy App"]

println("Items on todo list: \n todo.count")

2 Answers

Chris Shaw
Chris Shaw
26,676 Points

Hi Kenneth,

You have the correct answer in your println statement, however, you've added a string before it which isn't required. The challenge is simply asking for you to print the count for todo which we can do using the below.


Happy coding!

David Valles
David Valles
9,367 Points

You are printing "Items on todo list: \n todo.count"

the variable todo needs to be outside the " ". You dont need to display the message and your variable is not really a variable inside " ", it's just a string. the correct answer would be

println( todo.count)