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 Basics (Retired) Storing and Tracking Information with Variables Create a variable with a string

Mathias Szanto
Mathias Szanto
3,256 Points

Why the answer is "Jasmine" instead of "player" var in this challenge?

Hello, just did this challenge task, and maybe i'm too noob for the moment but, i didn't understand why the answer is "Jasmine".

we should write document.write("player"); instead of document.write("Jasmine"); in this task no?

Even the bummer error talk about the player var !

2 Answers

Louis Otto
Louis Otto
23,264 Points

Hi Mathias,

You're right in method, except you are writing javascript ("player") when to access a variable you must not include "", the correct method is javascript document.write(player);

Mathias Szanto
Mathias Szanto
3,256 Points

Oops yes, Louis :) but i do not understand... why, when i write, document.write("Jasmine"); the challenge pass?

Dave McFarland
Dave McFarland
Treehouse Teacher

Hi,

Thanks for pointing this out Mathias Szanto

I've fixed the Code Challenge so that students HAVE to use the variable. This doesn't pass anymore: document.write("Jasmine");

Louis Otto
Louis Otto
23,264 Points

It may simply be a limitation of the design of the tool. It is simply looking for a printed response of "Jasmine" which method you use (of the two available) to print that does not matter as long as it receives the correct output.

Cheers!

Mathias Szanto
Mathias Szanto
3,256 Points

Haha oh ok, thank you :)