RsD0p9BK
3/26/2018 - 10:09 AM

Fastest way to move first element to the end of an Array

// Fastest way to move first element to the end of an Array

var array = [8,1,2,3,4,5,6,7];
array.push(array.shift());  // results in [1, 2, 3, 4, 5, 6, 7, 8]

// https://stackoverflow.com/a/20385895/2618535