Hey JavaScript Guru's!
Ok i have this script that takes 2 items out of an array, then checks to make sure they arent identical.
Id like to boost this to 20 numbers, but i dont know how to structure the CHECK part.
Here is the check im using for the existing 2 item script ...
var s1=Math.floor(Math.random()*myimages.length)
if (s1==0)
s1=1
var s2=Math.floor(Math.random()*myimages.length)
if (s2==0)
s2=1
if(s1==s2){ if(s1==myimages.length) {s1=1;} else s1++; }
Now i need 20 items from my array without duplicating any of them, lol
Any ideas?
|