INNER CODE UNIT · JavaScript

randomNumberGeneratorInRange

Devs-Dungeon/Resources · Programming Languages/JavaScript/Theory/50_Days_Of_JS/Day 1/index.js:1

function randomNumberGeneratorInRange(min, max) {
    // write your solution here

    return Math.floor(Math.random() * (max - min + 1)) + min
}

console.log(`My random number: ${randomNumberGeneratorInRange(5, 100)}`)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…