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