Generator
run this program
code:gentest.js
function* generator_function(from, to){
while(from <= to) yield from++;
}
var g = generator_function(1, 5); // Generator
for(var num of g) alert(num);