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

Is he calling the constant a variable?

I noticed he called factBook a variable, even though it was declared as a constant using let. Even in the Xcode hints it has a V next to it for variable. Can constants be referred to as variables in a general sense, or am I missing something?

2 Answers

var is for variable and also means it could be change at anytime let for constant and you cannot change its value

// example

var x = 5 x= 6 println(x) // the new value is 6

let y = 7 y =8 // you can't do that because it a constant your compiler will complain

I had the same question. I understand the difference between a constant and a variable. The instructor refers to the factBook variable however the var keyword was never used in the code. I am still confused about this.