in reply to Re: random index in array - no duplicates
in thread random index in array - no duplicates
Or to be more precise. If you have an array of size N and you want to draw M elements from it (without duplicates), splice will take time proportional to N * M, while the suffle will take time proportional to N + M (or just M if you get a reference to the array).
Abigail
|
|---|