The shift function shifts the elements of an array by a specified amount
and returns the result. If n is positive, the ith element of the array
will be shifted to the position i-n of the array. Elements for
which i-n is less than 0 will be moved to the end of the array.