setimteout use function generator

Solutions on MaxInterview for setimteout use function generator by the best coders in the world

showing results for - "setimteout use function generator"
Luc
31 Jan 2019
1function showValue() {
2    return setTimeout(function() {
3        function* gen() {
4            console.log('yielding');
5            yield 100;
6        };
7        var it = gen();
8        console.log(it.next().value);
9    }, 1000);
10}
11showValue();             
12console.log(showValue());