let range = {
from: 65,
to: 90,
[Symbol.iterator]() {
return this;
},
next() {
if (this.from <= this.to) {
return {
done: false,
value: String.fromCharCode(this.from++)
};
} else {
return {
done: true
};
}
},
};
// A-W
for (let num of range) {
console.log(num);
}