I have an array
is of the form
var array = ["cat1", "cat2", "cat3"]
I would like to be able to randomly choose one of these elements, where each element is the actual name of another array.
So I also have
var cat1 = ["Q1", "Q2", "Q3"]
basically an array of questions.
this is a similar format for cat2
and cat3
.
Now the reason I want this is to randomly choose a topic for questions, then select a question from the chosen array, my problem is I don't know how to programmatically use, say for example,
cat2[1]
I basically want to display the contents of the element that is chosen.
Is this at all possible? I have been trying to get this to play nice for a while now :(
Thank you!