I am using ES6 classes. I want to achieve this.
function Grid(color) {
this.color = color;
};
Grid.prototype.indexes = [];
I want to set indexes as a property of protoype object. How to achieve this in ES6 classes?
class Grid {
constructor(color) {
this.color = color;
};
}
Edit: Is there any other alternative than below mentioned solution?
class Grid {
constructor(color) {
this.color = color;
};
}
Grid.prototype.indexes = [];
Disclaimer: I am completely new to javascript.