scrimba
Learn Basic JavaScript
Generate Random Whole Numbers within a Range
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Generate Random Whole Numbers within a Range
AboutCommentsNotes
Generate Random Whole Numbers within a Range
Expand for more info
index.js
run
preview
console
// Example
function ourRandomRange(ourMin, ourMax) {

return Math.floor(Math.random() * (ourMax - ourMin + 1)) + ourMin;
}

ourRandomRange(1, 9);

// Only change code below this line.

function randomRange(myMin, myMax) {

return 0;

}

var myRandom = randomRange(5, 15);

console.log(myRandom);
Console
8
,
index.html
-1:21