How can I shuffle a list of variables in JS and maintain the order while changing their values? The following code snippet demonstrates what I am trying to achieve.
<p id="demo"></p>
<script>
var gen = "male ";
var race = "white";
var rel = "christian";
var chars =[gen,race,rel];
chars = shuffle(chars);
document.getElementById("demo").innerHTML = chars+"";
/*prints for example "white christian male" which is what I want
/*lets say I want to change the gender, and maintain the newly shuffled order (race-rel-gen in this case)*/
/* The below doesn't work. I want it to print "white christian female", but it just reprints the original string*/
gen = "female ";
document.getElementById("demo").innerHTML = chars+"";
</script>