Repository URL to install this package:
|
Version:
1.2.1 ▾
|
"use strict";
/**
* @types (array: Array<any>): Iterator
* @param {Array<any>}
* @return {Iterator}
*/
module.exports = function fromArrayToInfiniteIterator(array) {
let index = -1;
return {
next() {
index += 1;
if (array.length <= index) {
index = 0;
}
return array[index];
}
};
};