@ -1093,7 +1093,7 @@
|
|||||||
"Here's the formula we'll use. Take a moment to read it and try to understand what this code is doing:",
|
"Here's the formula we'll use. Take a moment to read it and try to understand what this code is doing:",
|
||||||
"<code>Math.floor(Math.random() * (max - min + 1)) + min</code>",
|
"<code>Math.floor(Math.random() * (max - min + 1)) + min</code>",
|
||||||
"Define two variables: <code>myMin</code> and </code>myMax</code>, and set them both equal to numbers.",
|
"Define two variables: <code>myMin</code> and </code>myMax</code>, and set them both equal to numbers.",
|
||||||
"Then create a function called <code>myFunction</code> that returns a random number that's greater than or equal to <code>myMin</code>, and is less than <code>myMax</code>."
|
"Then create a function called <code>myFunction</code> that returns a random number that's greater than or equal to <code>myMin</code>, and is less than or equal to <code>myMax</code>."
|
||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert(myFunction() >= myMin, 'message: The random number generated by <code>myFunction</code> should be greater than or equal to your minimum number, <code>myMin</code>.');",
|
"assert(myFunction() >= myMin, 'message: The random number generated by <code>myFunction</code> should be greater than or equal to your minimum number, <code>myMin</code>.');",
|
||||||
|
Reference in New Issue
Block a user