Hi, what I want is to get a random value stored in a variable after iterating a loop array 10 times.
The code that I've made just throws me a letter.
If anyone can give me a hand with this, I would be grateful.
Greetings.
var palos = ["Trebol","Picas","Corazon","Diamantes"];
var combi=[];
for(var i = 0; i<palos.length; i++){
for(var j=1; j<=10; j++){
combi = combi + (" - Carta: "+j+" de "+palos[i]);
}
}
var random = combi[Math.floor(Math.random() + combi.length)]
console.log(random)