vendredi 18 août 2017

I am using a random number to pick from a random entry in an array but the first time I call the function it always picks the first entry of the array

This is in javascript.

var ranNum = Math.floor(Math.random() * (questions_array.length));  

Can you tell from this line why it would be picking the first element? Otherwise theres a whole bunch of code involved. I haven't been able to find anything after 30 minutes with the debugger and swapping around variables.




Aucun commentaire:

Enregistrer un commentaire