Random Number Challenge1:14 with Guil Hernandez
It's time for another programming challenge! In this challenge, you'll create a random number generator. It should collect a number from a user, then print a random number from 1 up to the user's provided number.
- Collect a user's input.
- Convert that input from a string to a number. This will be the highest possible random number in the range of numbers starting from 1.
- Use the
Math.random()method to create a random number using the number provided by the user.
- Create a message displaying the random number. You can use any method you want to display the message. For instance, print it to the console, display it on the page, or with an alert.
You need to sign up for Treehouse in order to download course files.Sign up