0
Javascript on repeat image generator
I want to write an image generator, there are 10 images in total and it will display 5 images randomly each time without repeating, I've tried math.floor(math.random()*10), but it will repeat sometime, any ideas???
1 Antwort
+ 1
Try this:
https://code.sololearn.com/WlVNAc0l2hbF/
You need to remove the image from the array when you use it so it can’t be used again. array.splice(index, 1) will do exactly that for you