Here is a very cool line of code to manipulate an array.
If you want to take the first item of an array and place it at the end:
myArray.push(myArray.shift());
If you want to take the last item of an array and place it back at the front:
myArray.unshift(myArray.pop());
Brilliantly simple!! Thanks a lot, you probably saved me some hours of headache…
have a nice week!