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 trialHeriberto Perez
1,298 Pointsjavascript basics:
Use the document.write() function to print the contents of the player variable to the page.
I wrote this and it saids that is wrong
document.write("player");
var player = "Jasmine";
document.write ("player");
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
<script src="app.js"></script>
</body>
</html>
2 Answers
Daniel Santos
34,969 PointsYour code should look something like
var player = "Jasmine";
document.write(player);
No "player", the reason that this happened is because you are passing the string "player" no the what the variable player evaluate to.
I hope this help.
Rich Donnellan
Treehouse Moderator 27,696 PointsIt is incorrect.
You are passing in the string "player"
, not the variable.
Rich Donnellan
Treehouse Moderator 27,696 PointsRich Donnellan
Treehouse Moderator 27,696 PointsI specifically avoided giving "the answer" to stimulate the brain activity of the OP. No benefit in doing the work for them.
Daniel Santos
34,969 PointsDaniel Santos
34,969 PointsI agree with you, but some people learn by looking at example. Some times it can be frustrating when you are stuck in a problem like this.
Rich Donnellan
Treehouse Moderator 27,696 PointsRich Donnellan
Treehouse Moderator 27,696 PointsAgreed; and I have done so recently. However, I feel this is not one of those times as this challenge is as basic as can be.
Bryan Tidwell
3,473 PointsBryan Tidwell
3,473 PointsThanks for the info, Daniel. I'm a visual learner, myself, and am still coming to grips with the terminology in programming. Thanks for laying it out.
Daniel Santos
34,969 PointsDaniel Santos
34,969 PointsThank you Bryan.