How to initialize a get array? I was no longer trying to do anything:
import Cell from './Cell'; export default class Cells { Get: Cell[]; constructor(x: number, y: number) { for (let i = 0; i < x; i++) { this.Get[i] = new Cell[x]; for (let j = 0; j < y; j++) { this.Get[i][j] = new Cell(x, y, this._createHtmlElement()); } } } _createHtmlElement(): HTMLElement { let t = document.createElement("div"); t.classList.add("cell"); return t; } } In this implementation, the error is:
TypeError: __WEBPACK_IMPORTED_MODULE_0__Cell__.a[x] is not a constructor Apparently the Cell class should have a constructor without parameters. Of course, I would have done it, if only it helped, but there still cannot be more than one constructor? What kind of nonsense?