WEBVTT

1
00:00:00.000 --> 00:00:01.740
In the random.js file, the first step
is collecting a number from a user.

2
00:00:01.740 --> 00:00:04.050
So I started by declaring a variable and

3
00:00:04.050 --> 00:00:06.980
storing input from
the user in the variable.

4
00:00:06.980 --> 00:00:09.920
You learned that the prompt
method returns a string,

5
00:00:09.920 --> 00:00:12.800
even if someone types
a number into the dialog box.

6
00:00:12.800 --> 00:00:17.360
So the value of inputHigh needed to
be converted into a number type.

7
00:00:17.360 --> 00:00:21.770
I used the parseInt method to do that,
and I stored the number value in

8
00:00:21.770 --> 00:00:26.400
a variable named highNumber to represent
the highest possible random number.

9
00:00:26.400 --> 00:00:29.640
With this, I was able to
generate a random number from 1

10
00:00:29.640 --> 00:00:30.000
to whatever the user typed in.
