JavaScript JavaScript Basics Storing and Tracking Information with Variables Create a variable with a string

Garry nosirov
Garry nosirov
Full Stack JavaScript Techdegree Student 985 Points

Use the document.write() function to print the contents of the player variable to the page.

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

app.js
var player='Jasmine';
document.write('Jasmine');
index.html
<!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>

1 Answer

Brendan Whiting
Brendan Whiting
Front End Web Development Techdegree Graduate 71,577 Points

They want you to pass in the player variable into document.write, rather than the same string again.

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