Hacker News new | past | comments | ask | show | jobs | submit login

This can be condensed slightly, you don't need the inner function literal. In Typescript:

    class MyCollection<T> {
     *[Symbol.iterator](): IterableIterator<MyCollectionEntry<T>> {
      for (const thingy of this.thingies) {
       yield { ... }
      }
     }
    }



Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: