Created
August 2, 2020 03:50
-
-
Save parzibyte/eaf126d9e799a37784cfe0ef6f53574e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const obtenerNumeroAleatorioEnRango = (min, max) => { | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} | |
// Probar con 10 números aleatorios entre 1 y 100 | |
for(let i = 0; i < 9; i++){ | |
const numeroAleatorio = obtenerNumeroAleatorioEnRango(1, 100); | |
console.log("Aleatorio: ", numeroAleatorio); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment