mardi 15 novembre 2022

I want generate random list of numbers with javascript

I want generate random list like this

09125856769
09126516511
09127455132
09122318715
09127841522

this is my code

let numbers="0123456789";
let all=null;
let howMuch=prompt("how much you want?");
let countryCode=prompt("enter countrycode");
let numberLentgh=prompt("enter number lentgh");
for(let x=0;x<howMuch;x++){
    for(let i=0;i<numberLentgh;i++){
        let random=Math.floor(Math.random()*numbers.length);
        all=countryCode+=numbers[random];
    };
    console.log(all);
}



Aucun commentaire:

Enregistrer un commentaire