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.

iOS Swift Basics (retired) Variables and Constants Constants

AJ Thomas
AJ Thomas
249 Points

i don't get how to write the constant

Iv'e tried to write it multiple times and I don't know how


1 Answer

Jared Watkins
Jared Watkins
10,756 Points

You declare a constant typing 'let' and then the name of the constant. The task asks you to name the constant language, so that is it's name. Then, you you say what the constant is, or what the constant is equal to, or what the constant is holding.. So, if you want your constant to be a string like "Swift", you set the constant equal to " Swift". the quotes mean it's a string, so that's why you use them.

It might look like this:

let language = "Swift"