var b = 5
{
let b = 10var GeneratorFunction = Object.getPrototypeOf(function*(){}).constructor
var g = new GeneratorFunction("a", "yield a * b * 2");
var iterator = g(10);
console.log(iterator.next().value); // 100functiontest() {
console.log(b)
}
test() // 10
}
複製代碼