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

Random Challenge

I was no where close to a solution. !!!!!!.. I understand each module but when you have to put together like the challenge I am completely lost....

https://w.trhou.se/f68a6srs57

2 Answers

can u link the challnage ?

Steven Parker
Steven Parker
243,173 Points

The spelling of variable names isn't important (except to readability) as long as you use the same name consistently throughout the program. But you created a variable named "randomnNumberA" (with an extra "n"), but later referred to it as "randomNumberA".

Also, it's important to use quote marks in pairs of the same type. In the "alert" call on the last line, there is a mix of apostrophes (') and double quotes (").

If you start with the first challenge, you'll create a random number very similar to what was done in the Create a random number video, and you can use that code as a model. For the "even further" challenge, you'll apply a slightly different formula to create a random number within a range, which you can find on this MDN page under Getting a random integer between two values, inclusive. But in both cases, you'll probably want to ask the user for number(s) from a wider range than just 0 to 1.