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

Does the string has to be named "str" or its name is totaly up to me?

in the exmaple it was:

var str = "Hello, playground"

can i modify the name as i wish like in the following?:

var ihf = "Hello, playground"

2 Answers

Yes, you can. You can name your variables and constants anything you want, but try and keep them related to what the value is. For instance, If you are assigning the string "dog", to a variable, don't type:

 var pinapple = "dog"

as that makes no sense and will be wierd to read over. You will leanr these naming conventions in later videos

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hi Yosef,

Unless it's a Challenge you are doing for the course, variables can have any name you wish them to have. In Treehouse Challenges, however, the code checker is very picky, so if it asks for a specific variable name, it has to be that.

Keep Coding! :) :dizzy:

Thanks alot!