setimteout use function generator
function showValue() {
return setTimeout(function() {
function* gen() {
console.log('yielding');
yield 100;
};
var it = gen();
console.log(it.next().value);
}, 1000);
}
showValue();
console.log(showValue());
Are there any code examples left?
New code examples in category Javascript