News for hackers. Stuff that matters.
Re:ES6 Overview in Bullet Points by _greim_ on Friday November 27, 2015 @09:24PM (#10639751)
Too many use cases to list, but generally a nice way to for...of anything, for example a recursive binary tree traversal:

    [Symbol.iterator]() {
      if (this.left) {
        yield* this.left[Symbol.iterator]();
      }
      yield this.value;
      if (this.right) {
        yield* this.rightSymbol.iterator]();
      }
    }
    ...
    for (const value of myTree) { ... }

There are no comments on this comment yet.