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.

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

Have you checked your browser's console? Other than that without showing your code it's hard to tell.

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?

You can use treehouse Workspaces, but I suggest you to write all your code locally and preview it on browser. The best text editor for me is Sulime Text with Emmet plugin

```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;