Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed JavaScript Functions!
You have completed JavaScript Functions!
Preview
This video covers one solution to the function challenge.
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
The difference is that now you're using
a function that accepts arguments.
0:00
For starters, I'll create
a function named getRandomNumber.
0:04
I'm using a function decoration, but
0:10
you could have written this as a function
expression or as an arrow function.
0:11
The function should produce a random
number value between two numbers.
0:16
So I need to add two
parameters to the function.
0:20
I'll call them lower and upper.
0:22
Next, I'll move the random number
code into the function and
0:27
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up