Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyClass {
- arr = [];
- constructor(width, height) {
- this.makeArray(width, height);
- }
- makeArray(width, height) {
- this.arr = new Array(width * height);
- }
- }
- class MyClass2 {
- arr = [];
- constructor(width, height) {
- this.width = width;
- this.height = height;
- this.makeArray();
- }
- makeArray() {
- this.arr = new Array(this.width * this.height);
- }
- }
- class MyClass3 {
- arr = [];
- constructor(width, height) {
- this.arr = this.makeArray(width, height);
- }
- makeArray(width, height) {
- return new Array(this.width * this.height);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment