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

my Javascript isn't good...I'm sorry.....

Where's the problem for this question?

var player = ('Jasmine'); 
function document.write ('');

thanks.....

Hi Massimo here's the solution: first of all you need to assign a variable a value with NO parentheses, so what you've written becomes → var player = 'Jasmine';

Then you don't need a function to print the value of the variable, that is 'Jasmine'. You could do it, but it's a bit more complex. The simple solution is to "insert" the variable name, player, straight into the parentheses of document.write.

So here's how you'll get this:

var player = 'Jasmine'; document.write(player);

Give your best! ;)

2 Answers

var name = "jasmin";
function callName(name) {
document.write(name);
}

callName(name);

Thanks!

No problemo man. :smile: