JavaScript JavaScript Basics Creating Reusable Code with Functions Review: Giving Information to Functions

Jorge Montava Arsis
Jorge Montava Arsis
1,648 Points

Please fill the blank exercise..

Could someone help me to complete it?

thank you!

Complete the code below to call the function and pass the value 12 to it:

function getRandom( upper ) { return Math.floor(Math.random() * upper) + 1; }

2 Answers

Steven Parker
Steven Parker
171,373 Points

To "call" (or "invoke") a function, you just write its name followed by a pair of parentheses. Anything you wish to pass to it goes inside the parentheses.

Jorge Montava Arsis
Jorge Montava Arsis
1,648 Points

Yes, thank you I have done it. All sorted.