## Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

### Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

# what is wrong with my javascript file because every time I try to preview I got nothing except a title on the page?

Let’s Make Random Numbers --- is all i see on top-left corner of the page.

can anyone elaborate what I am missing? Thanks

this is my javascript code:

function randomNumber(upper) { return Math.floor( Math.random() * upper ) + 1; } var counter = 0; while ( counter < 10000 ) { var randNum = randomNumber(6); document.write(randNum + ' '); counter += 1; }

and this is my html code:

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Let’s Make Random Numbers</title> <link rel="stylesheet" href="styles.css"> </head> <body> <h1>Let’s Make Random Numbers</h1> <script src="video2-script.js"></script> </body> </html> You need to write you `while` loop on proper way. Like in code below:

```function randomNumber(upper) {
return Math.floor( Math.random() * upper ) + 1;
}

var counter = 0;
while ( counter < 10 ){
var randNum = randomNumber(6);
document.write(randNum + ' ');
counter++;
}
```

This code will generate 10 random numbers - https://jsfiddle.net/k53kxof1/

Thanks Sergey, that helpful at the end!

hey Sergey!

Do you know how I can setup my own javascript environment so that I can code along with the instructor as he teaches the lessons? ```var questions = [
{
question: 'How many states are in the United States?',
},
{
question: 'How many continents are there?',
},
{
question: 'How many legs does an insect have?',
}
];
var question;
var response;

function print(message) {
document.write(message);
}

for (var i = 0; i < questions.length; i += 1) {
question = questions[i].question;