var palos = ['P','T','C','D'];
var palos2= palos;
var almacenInicial1 = palos[elecion];
var almacenInicial2 = palos[elecion2];
for(var i= 0;i<10;i++){
var elecion = Math.floor(Math.random()*palos.length);
var elecion2 = Math.floor(Math.random()*palos.length);
palos2[elecion2]= palos2[elecion];
palos2[elecion]=palos2[elecion2];
}
I am creating a program which allows me to shuffle the elements of the array, the objective is for the program to change positions 'without repeating any element'. But the elements are repeated to me. And investigated and what I could understand is that I must store two random positions and store each one individually, then change the position 1 for the two and vice versa and thus should not repeat any element. But only the elements are repeated, and I can not manage to change the elements without being repeated, Gelp me, Please !!