Rotate an array to a given index
npm install rotate-array-to
import rotateArrayTo from "rotate-array-to";
const array = [ "apples", "oranges", "bananas", "peaches" ];
rotateArrayTo(array, 2); // [ "bananas", "peaches", "apples", "oranges" ]
Made with 💖 by NewOrbit in Oxfordshire, and licensed under the MIT Licence