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

i know the error is in the message but what is it? https://w.trhou.se/4wyh2mkqu9

hey, i am learning javascript basics so I was trying to create something on my own, I know that the error is in the message section but what is it?

https://w.trhou.se/4wyh2mkqu9

2 Answers

var message = "<p>" + "You will Become a millionaire at the age of:" + randomNumber "</p>";

The error is at this line, you forgot to put a + after randomNumber i think ! like this : var message = "<p>" + "You will Become a millionaire at the age of:" + randomNumber + "</p>";

it didn't t work ;(

Caleb Kemp
Caleb Kemp
13,130 Points

Hugo was right, you were missing the "+" sign, (and that did need to be fixed), but your main problem is actually a little different. Your html file is unable to find your javascript file. What's that you say? Well, somehow, accidentally I suppose, in your html file it is searching for

<script scr="scripts.js"><script>

however the name of your javascript file is "script.js", you can either rename your javascript file or change the html script part to

<script scr="script.js"><script>

hope that helps