Sawtaytoes
3/9/2019 - 8:17 AM

Generator as an Iterator and Iterable

const next = () => {
  // Do some processing...
}

{
  next,
  [Symbol.iterator]: () => ({
    next,
  }),
}