How would I make an iterator out of an ES6 class in the same manner as JS1.7 SomeClass.prototype.__iterator__ = function() {...} syntax?
SomeClass.prototype.__iterator__ = function() {...}
[EDIT 16:00]
Define a suitable iterator method. For example:
class C { constructor() { this.a = [] } add(x) { this.a.push(x) } [Symbol.iterator]() { return this.a.values() } }
Edit: Sample use:
let c = new C c.add(1); c.add(2) for (let i of c) console.log(i)