CHALLENGE
const counter = {
count: 0,
*[Symbol.iterator]() {
yield this.count++;
yield this.count++;
yield this.count++;
}
};
console.log([...counter], counter.count);
export {};🤔4🔥1
What is the output?
Anonymous Quiz
18%
[ 0, 1, 2 ] 2
34%
[ 0, 1, 2 ] 0
29%
[ 0, 1, 2 ] 3
18%
[ 1, 2, 3 ] 3
❤3🤔1