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 trialErin Doherty
4,368 PointsUsed a different solution that seems to work - am I wrong?
This is the code I used - the var randomNumber part I used seems simpler and easier than what the instructor used and seems to work just fine, but perhaps there's something I'm missing. Math is not my strong suit, alas. Any insight you can offer would be great!
var input = prompt('Give me your low number.');
var lowNumber = parseInt(input);
var input2 = prompt ('Now give me your high number.');
var highNumber = parseInt(input2);
alert('Thanks! Hit the ok button to get your random number.');
var randomNumber = Math.floor(Math.random () * highNumber) + lowNumber;
document.write(randomNumber + ' is your random number between ' + lowNumber + ' and ' + highNumber + '.');