Shift array items by n steps If n > 0 items will shift n steps to the right If n < 0 items will shift n steps to the left
const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9]shift(arr, 3) // => [7, 8, 9, 1, 2, 3, 4, 5, 6] Copy
const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9]shift(arr, 3) // => [7, 8, 9, 1, 2, 3, 4, 5, 6]
Description
Shift array items by n steps If n > 0 items will shift n steps to the right If n < 0 items will shift n steps to the left
Example