Generator functions in JavaScript

function* gen() {
    yield 1
    yield 2
}