I have an array of arrays.
var ArrOfarr = { A1: ["choice", "choice2", "choice3"], A2: ["choice1", "choice2"], A3: ["choice1", "choice2"], A4: [], A5: [], A6: [], A7: [] }
I want to pick random array from the 'ArrOfarr' each time I click a button. I tried the below, but seeing 'undefined':
function A()
{
var item = ArrOfarr[Math.floor(Math.random()*ArrOfarr.length)];
alert(item);
}
how can I pick up random array form the above Array(Without repeat till it reaches its length). And how can I get the name of randomly picked array?