A javascript library that offers extended functionality to standard javascript object types.
Currently in production, contributors welcome.
Returns an object with useful helper methods for stepping through the array with .next() and .previous()..
let array = [1, 2, 3, 4];
let arrayCycle = array.cycle();
NOTE: Without providing arguments the cycle starts at the first index of the array. You can optionally pass in a starting index.
arrayCycle.start();
Optionally takes a starting index.
Step 4: Cycle by calling either next() or previous() methods.
arrayCycle.next();
let arrayCycle = ['John Smith', 'Chris Johnson', 'Mike Henry', 'Amy Michelle'].cycle();
arrayCycle.start(1);
arrayCycle.next();
arrayCycle.previous();