Answers for "js generate list of names with forloop"

1

dynamic loop variable .each create hash javascript

for (var i = 0; i < coords.length; ++i) {
    this["marker"+i] = "some stuff";
}
Posted by: Guest on August-20-2020
0

js generate list of names with forloop

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();
//results in console:
//wqdwxe	unmokä
//iuqckn	roloäk
//istqtu	äuäayi	
//;)
Posted by: Guest on December-27-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language