lundi 18 juillet 2016

Javascript - Random number generator given the number of digits [duplicate]

This question already has an answer here:

Given a number, i want a random number generator. For eg -

generaterandom(4) //should return a 4 digit random number like 9233, 4112 ...
generaterandom(8) //random 8 digit random number.

I thought of many ways, but could not come up with a solution. Pls help!




Aucun commentaire:

Enregistrer un commentaire