as-circular-array
v1.0.1
Published
Simply circular iteration over any array. 100% coverage, no deps.
Downloads
8
Readme
as-circular-array
Simply circular iteration over any array. 100% coverage, no deps.
Usage
const circular = require('as-circular-array'),
const next = circular([1,2]);
console.log(next()); // prints 1
console.log(next()); // prints 2
console.log(next()); // prints 1
console.log(next()); // prints 2
API
circular(array[,startIndex])
- array the array you want to make circular
- index Optional index to start. Default is 0.