I have 9 variables in my javascript code.
s1 = 'n';
s2 = 'n';
s3 = 'n';
s4 = 'n';
s5 = 'n';
s6 = 'n';
s7 = 'n';
s8 = 'n';
s9 = 'n';
I created a function that randomly selects a number from 1-9
function bot() {
var generateRandomNumber = Math.floor(Math.random() * 9) + 1;
console.log(generateRandomNumber);
}
How to do it in this function to make it replace the contents of the variable s+generateRandomNumber = 'x'
?