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

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);