ts-jsdk
Version:
TypeScript implementation of the Java platform
17 lines • 374 B
JavaScript
export class JIterator {
constructor(iterator) {
this.iterator = iterator;
}
hasNext() {
return !this.iterator.next().done;
}
next() {
if (this.hasNext()) {
return this.iterator.next().value;
}
else {
throw new Error("No more items");
}
}
}
//# sourceMappingURL=JIterator.js.map