Skip to content

shift

Shift array items by n steps

145 bytes

Usage

Given a list of items, return an array that shift right n positions.

import * as _ from 'radashi'
const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9]
_.shift(arr, 3) // => [7, 8, 9, 1, 2, 3, 4, 5, 6]