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
Ejimonye OFODUM
Courses Plus Student 1,851 PointsPlease how can I create a variable named myAge and assign it a number value
Please how can I create a variable named myAge and assign it a number value
3 Answers
theodevries
15,895 Pointsvar myAge = 12; or latest version Javascript you can use let and const instead of var. example: let myAge = 12;
rovelle trinidad
390 PointsMaybe there was something before that? was it var myName = 'your name';
and then you add under it var myAge = ?
Ejimonye OFODUM
Courses Plus Student 1,851 Pointsvar myAge = 13; let myAge = 13; const myAge = 13;
Ejimonye OFODUM
Courses Plus Student 1,851 PointsEjimonye OFODUM
Courses Plus Student 1,851 PointsIt didn't work
theodevries
15,895 Pointstheodevries
15,895 PointsWhat exactly did you try? Can you show your code? Please provide some context?