mercredi 31 mars 2021

Take random array in a 2D named Array in Javascript

I'd like to take a random array from a 2D named array but all solution I tried didn't work maybe someone could help

var sites = [];

sites['apple'] = [
'green'
,
'red'
,
'blue'
];

sites['orange'] = [
'yellow'
];

There is more and of course not these names and the number is not fix and I'd like to take one random array. (Not item !)

Is it possible ?




Aucun commentaire:

Enregistrer un commentaire