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 Loops, Arrays and Objects Simplify Repetitive Tasks with Loops A Closer Look at Loop Conditions

Matthew Lehman
Matthew Lehman
5,282 Points

May someone please take a look at my code

https://w.trhou.se/oxtyw5asjl

for some reason there is an error, and I just cant find it to get it fixed.

any help would be highly appreciated

1 Answer

Your app.js file has syntax errors in the last two lines of code:

document.write:("<p>The random number was: " + randomNumber + "<p>");
document.write:("<p>It took the computer " + attempts + " attempts to get it right.</p>);

You have colons after 'document.write', and you are also missing a double quote. The code should be:

document.write("<p>The random number was: " + randomNumber + "<p>");
document.write("<p>It took the computer " + attempts + " attempts to get it right.</p>");
Matthew Lehman
Matthew Lehman
5,282 Points

Thanks a lot Mark.

I figured out I had a typo after I submitted this question. Thank you for catching that for me.