vendredi 1 décembre 2017

How can I get a random result from an array, then based on that result get another random result from another array?

I have an array

var firstArray = [ "Blue", "Red", "Green" ];

Red

I want to click a button and display a random result from that array, let's say it's "Red". Then based on that result "Red" I want to click a second button and get another random result from another array.

var redArray = [ "Apple", "Firetruck", "Rose" ];

Red - Rose

Then I want to click the first button again, get a new result and clear the second button's result.




Aucun commentaire:

Enregistrer un commentaire