I am trying to take an array and have it loop around itself. I already found a simple solution for having it loop around itself backwards:
array = ['Dog', 'Cat', 'Animal', 'Pig']
array[array.length] = array[0];
array.shift();
This as expected turns out as ['Cat', 'Animal', 'Pig', 'Dog']. How would I make it do the opposite in a similar manner. By doing the opposite I mean turning out ['Pig', 'Dog', 'Cat', 'Animal']. I have tried to find the opposite of .shift() for this but can't find anything. Thank you for your time.