Sawtaytoes
3/9/2019 - 7:45 AM

Generator creating its own Iterator

const createGenerator = function* (
  array,
) {
  let index = 0
  
  while (index < 3) {
    yield array[index]
    
    index = index + 1
  }
}