JSFiddle - React, Tailwind, and code Playground

by Alexander Branchugov

JavaScript

function* genExmaple() {
  var index = 0;
  
  yield index++;
  yield index++;
  yield index++;
  yield index++;
  yield index++;
  yield index++;
}


var gen = genExmaple();


setInterval(() => console.log(gen.next()), 1000);