I am trying to implement a range property on a sequence object with the following code:
function RangeSeq(from, to) {
this.array = [];
this.from = from;
this.to = to;
this.arraySeq = new ArraySeq(this.range);
}
Object.defineProperty(RangeSeq.prototype, "range", {
get: function() {
for (var i = this.from; i <= this.to; i++) {
array.push[i];
console.log(this.array)
}
return array;
}
});
However, after running the code above, the array object still remains empty. Why is this so and what's the right way to solve this?
this.array
not justarray