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 trialIChen Tsai
3,412 PointsCreate a variable named answer but don't put a value in it yet.
Create a variable named answer but don't put a value in it yet.
<!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>
5 Answers
Shezan Kazi
10,807 PointsHi,
what exactly is your question. In JavaScript you create variables with the keyword var.
For example var pi = 3.14;,
without a value just type var pi;
Tyson Ehlers
1,626 PointsThe way I got the answer in the scripts.js tab is as follows:
var answer ='';
Good luck!
Peter B. Sims
Courses Plus Student 2,896 Pointsvar answer;
Quang Nguyen
2,235 PointsHi Tsai,
The way how I have solved this challenge is as of following:
<body>
<script src="scripts.js">
var answer;
</script>
</body>
I hope this will help you solve this challenge with ease.
A X
12,842 PointsAs far as I'm aware Quang, you don't need the body or script tags that you included to solve this code challenge. Just simply typing var answer ;
will solve it.
kathyvuong
9,299 Pointsvar myName =""; This a correct answer