Here for the Service class I like to create a default iterator. I need to make service iterable but I can not think further. I believe I need to use *Symbol.iterator but don't know how to use
class Service {
constructor() {
this.link = [];
}
}
var service = new Service();
service.link.push(1);
service.link.push(2);
service.link.push(3);
for (let x of service) {
console.log(x);
}