arr-rotate
Rotate all items in an array
Install
$ npm install arr-rotate
Usage
const arrRotate = ; ;//=> ['bar', 'unicorn', 'foo'] ;//=> ['unicorn', 'foo', 'bar'] ;//=> ['bar', 'unicorn', 'foo']
API
arrRotate(input, num)
input
Type: Array
Array to rotate.
num
Type: number
Default: 0
Number of steps to rotate.
License
MIT © Kevin Martensson