samedi 9 janvier 2016

Using a button, and random within functions within arrays etc in Javascript?

So yeah

I have 2 Arrays, A and B, each with 25 user input items. I have a button in HTML. I want this button to call a function that randomly chooses between ArrayA and ArrayB (both are referred in an array called 'randArray'). I then want to set an if/else statement which calls a function for ArrayA or ArrayB, randomly generating one of the 25 items and displaying the result (and some other text) to the

I'm quite new to JS and am having trouble ordering the functions within the functions, and am unsure how to use random properly. I will post what code I have already in the morning, unable to now. Any help, advice, or resources to learn would be appreciated.

Many thanks.




Aucun commentaire:

Enregistrer un commentaire