class A {
constructor(x, y, z) {
this.x = x;
this.y = y;
this.z = z;
}
*[ Symbol.iterator ]() {
yield this.x;
yield this.y;
yield this.z;
}
}
const v = new A(1, 2, 3);
console.log(v);
console.log(...v)
console.log([...v])
for (const i of v) {
console.log(i)
}
