Skip to content

Latest commit

 

History

History
21 lines (12 loc) · 459 Bytes

README.md

File metadata and controls

21 lines (12 loc) · 459 Bytes

rotate-array-to

Rotate an array to a given index

Installation

npm install rotate-array-to

Usage

import rotateArrayTo from "rotate-array-to";

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

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

License

Made with 💖 by NewOrbit in Oxfordshire, and licensed under the MIT Licence