Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

convert promise to generator js

function* count(){
  for (var x = 0; true; x++) {
    yield x
  }
}

for (var x of count()) {
  console.log(x)
}
Source by www.promisejs.org #
 
PREVIOUS NEXT
Tagged: #convert #promise #generator #js
ADD COMMENT
Topic
Name
5+7 =