let set = new SortedSet([-10, 5])
let iterable = {
[Symbol.iterator]: () => set.iterate(0, 4)
}
for (const a of iterable) {
console.log(a)
}
shows -10
This is because of
function Iterator(set, start, end) {
this.set = set;
this.prev = null;
this.end = end;
if (start) { // <- it is false when start == 0
var next = this.set.findLeastGreaterThanOrEqual(start);
if (next) {
this.set.splay(next.value);
this.prev = next.getPrevious();
}
}
}
shows -10
This is because of