JSFiddle - React, Tailwind, and code Playground

by ifandelse

JavaScript

function* counter( start, count ) {
	while( start <= count ) {
  	yield start++;
  }
}

for(var i of counter(1, 11)) {
	console.log(i);
}
/* output:
	1
  2
  3
  4
  5
  6
  7
  8
  9
  10
  11
*/