Answers for "js generate random list of names with for loop"

0

js generate random list of names with for loop

function amppari() {
var text = "";
var text1 = "";
var text2 = "";
var text3="";
var text4= "";
var text5= "";


  var possible = "abcdefghijklmnopqrstuvwxyzöä";

  for (var i = 0; i < 6; i++){
    text += possible.charAt(Math.floor(Math.random() * possible.length));
text1 += possible.charAt(Math.floor(Math.random() * possible.length));
text2 += possible.charAt(Math.floor(Math.random() * possible.length));
text3 += possible.charAt(Math.floor(Math.random() * possible.length));
text4 += possible.charAt(Math.floor(Math.random() * possible.length));
text5 += possible.charAt(Math.floor(Math.random() * possible.length));
   

}
console.log(text+"\t"+text1+"\n"+text2+"\t"+text3+"\n"+text4+"\t"+text5+"\t");

}
amppari();
Posted by: Guest on December-27-2020

Code answers related to "js generate random list of names with for loop"

Code answers related to "Javascript"

Browse Popular Code Answers by Language