I dont think I can use splice here as I dont know the index of the random element I just picked...
If you are comfortable with a splice-solution, you may change the way you select your random element: just select a random index (instead of the element itself.)
HTH, RataIn reply to Re: Pick random element from array and delete it
by Ratazong
in thread Pick random element from array and delete it
by vishi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |