javascript loop through array of objects randomly code example
Example: 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();