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 trialsean farrelly
1,614 Pointscreate a variable name myname but don't put anything in it yet.
create a variable name myname but don't put anything in it yet
var message="myname" ;
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
<script src="scripts.js"></script>
</body>
</html>
sean farrelly
1,614 PointsThanks Erik for the reply yeah its var myName = ""; what i was doing wrong was not putting the capital N in name thanks for the help.....
4 Answers
Jennifer Nordell
Treehouse TeacherHi there! Your code has a variable named "message" with a string assigned it to named "myname". What they want is the variable to be named myName
. Give it another go!
sean farrelly
1,614 Pointsvar myName = ""; don't for get to put the capital N in name .....
jason chan
31,009 Pointsvar myName;
Peter Furler
31,647 PointsIn javascript it is not required to assign a value to a variable when you declare, if you precede the name/identifier given to the variable with the keyword var. For example: var age;
When doing so, the data type of the variable is said to be undefined.
Erik Nuber
20,629 PointsErik Nuber
20,629 PointsIt would be the other way around but you are close
var myname = "";