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.

JavaScript JavaScript Quickstart Data Types and Variables Creating Variables

Felix Westphal
Felix Westphal
3,956 Points

Create a new variable named myAge and assign it a number value _ How do I resove this?

I am stuck on a question on Javascript basic. The question is:

Create a new variable named myAge and assign it a number value.

I have tried to retake the full course but I’m still not sure what the correct solution is. I have so far tried with these different ones:

Var myAge = 10; Var myAge = "10"; Var myAge = '10';

My error message says: Bummer , did you create a string value to the number value.

scripts.js
var myAge = 10;

1 Answer

Felix Westphal
Felix Westphal
3,956 Points

Found an answer that worked: var myName = "Felix"; var myAge = 27; var response = myName + " is " + (myAge);