An open API service indexing awesome lists of open source software.

https://github.com/neworbit/rotate-array-to

Rotate an array to a given index
https://github.com/neworbit/rotate-array-to

package

Last synced: about 1 year ago
JSON representation

Rotate an array to a given index

Awesome Lists containing this project

README

          

# rotate-array-to

Rotate an array to a given index

## Installation

npm install rotate-array-to

## Usage

```typescript
import rotateArrayTo from "rotate-array-to";

const array = [ "apples", "oranges", "bananas", "peaches" ];

rotateArrayTo(array, 2); // [ "bananas", "peaches", "apples", "oranges" ]
```

## License

Made with :sparkling_heart: by [NewOrbit](https://www.neworbit.co.uk/) in Oxfordshire, and licensed under the [MIT Licence](LICENSE)