Question: what does the following code snippet log in the last line?
```js
function* gen() {
yield this;
}
let genObj = new gen();
let [_this] = genObj;
console.log(_this === genObj); // ???
```
I’m finding three answers:
1. The spec says [1] that any reference to `this` in a generator
Question: what does the following code snippet log in the last line?
```js
function* gen() {
yield this;
}
let genObj = new gen();
let [_this] = genObj;
console.log(_this === genObj); // ???
```
I’m finding three answers:
1. The spec says [1] that any reference to `this` in a generator
2 matches
Mail list logo