mercredi 24 mars 2021

find random number between -7 and -12 with javascript [duplicate]

I got this javascript code that returns a random integer number between 1 and 10.

I got a problem making it return a random number between -7 and -12.

You gotta bail me out of this one, please...

const a = Math.floor(Math.random() * (10 - 1)) + 1;
console.log(`Random value between 1 and 10 is ${a}`);



Aucun commentaire:

Enregistrer un commentaire