I tried to find the answer for this but essentially I have not been successful, I am trying to a way to have two arrays like the following
{
"number": ['1', '2', '3', '4']
}; {
"color": ['Red', 'Yellow', 'Blue', 'Green']
};
Now say I make a function to make the image get selected randomly:
function random(number) {
return number[Math.floor(Math.random() * number.length)];
}
Now what I wanted to know is if there was a way that I could take the random result from my function and use it to not only get a random number but also get a corresponding color for it, so for 1 I also want Red, for 2 I want yellow.
Specifically, I am trying to create an embed with two fields
.addField('Your Number', random(number))
.addField('Your color',//what would I put here
What would I put in the last section to get the corresponding color based on the value of the random function in the previous field?
Any help or guidance on this is greatly appreciated!