Let's say I have an array of size 5. I want to take an index (from 0-4) as input and iterate through the array, starting with the index set.
For example, if the pointer was 3, I want to repeat it like this:
arr[3] arr[4] arr[0] arr[1] arr[2]
I can think of many ways to do this, but what kind of Ruby is this?
arrays ruby iteration
nfm
source share