Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

convert promise to generator js

function count(n){
  var res = []
  for (var x = 0; x < n; x++) {
    res.push(x)
  }
  return res
}

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