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.
How do you create a new variable?
I have typed in var = 'myage' to create a new variable and then add a string with var response = '43' but keep getting an error message
var = 'myAge' var response = '43'
You are close, the only thing is that you split it into two variables when if you combine them, you'll have the correct answer
you have the ability to name your variables, so an example would be
var fruit = 'apple';
now keep this in mind for your name
I think the conceptual issue here is fully understanding a string and what makes it a string..
The big concept of a string is that you surround it with '' or "" to create the string, and strings can be STORED in a variable. Think of the variable as a box, and in that box you can store things like strings, numbers, booleans, etc....
So should a variable be a string? Or is a variable something different? As of right now, you are assigning your variable to be a string.
I hope this helps steer you in the correct direction! :) Happy coding!