not extract the same thing continuously from an array

Asked 5 months ago, Updated 5 months ago, 15 views

What technique should I use to randomly extract one element of an array and not sequentially extract the same element?

The parts that are taken out at random are made.
I'm sorry it's rough
Please let me know


2022-09-30 12:06

1 Answers

1) Remove selected elements using splice.
2) Replace the selected element with the last element to reduce the selection range by one without pop or pop

2022-09-30 12:06

If you have any answers or tips

© 2023 OneMinuteCode. All rights reserved.