An object-oriented way to iterate using I loops.
npm install iteradorThis is your first program in Iterador:
const Iterador = require("iterador");
const Iterator = Iterador.Iterator;
const iterator = new Iterator();
iterator.skip(4);
iterator.loopBackward(9000, 3, function(index) {
console.log(index + " days before Christmas");
});The first thing you need to know about is the Iterator class. It contains siz publicly accessible methods, skip(), loopForward(), and loopBackward(). This is an iterator function, so first, we'll talk about the skip function, which is maybe easiest to understand.
Removes a skip index or multiple indexes from the Index Blacklist.
In advance, puts a specific index on a blacklist, so when iterator reaches that point, ignores the function entirely and moves on till it finds an index that isn't blacklisted.
Creates a normal I loop and runs iterationFunction() every loop. Every function beginning with loop will give parameter (i) as in current index.
Creates a backwards-running I loop and runs iterationFunction() every loop. Every function beginning with loop will give parameter (i) as in current index.
Sets persistent index memory.
Gets persistent index memory.
You can also use this.generalMemory to set persistent memory through an object.