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 trialbhavya malik
Courses Plus Student 2,140 PointsWhy didn't we type var RandomNumber = Math.floor(Math.random() *6 )+1 in the 2nd line instead of 1st ?
When I wrote this code in the 2nd line, and the prompt command in 2nd line my code didn't work.
4 Answers
Nicholas Olsen
Front End Web Development Techdegree Student 19,342 PointsCan you show me your code?
Andrew Geisler
7,246 PointsHi Bhavya, Did you remember to save your script.js file?
Andrew Geisler
7,246 PointsHi Bhavya, Did you remember to save your script.js file?
Erik Veerman
3,988 PointsIf you want to test the program for a right answer, it can take a lot of tries before you guessed right.
You can put a console.log(randomNumber) on line 2 and cheat the program for testing purposes. If you put the prompt first you cannot do this.
Ivan Saveliev
9,153 PointsIvan Saveliev
9,153 PointsHi Friend, if you still need assistance please add your code, because it's hard to understand what's the problem.