I wanted to execute a function of the own class in the constructor of that class, in this case the purpose was that the class was going to be a game so in the constructor when calling it a function was executed to initiate that modifies what was . but when calling the variable in the constructor I get that it is not defined.
class JuegoSnake {
constructor() {
this.scl = 40;
this.canv.width = window.innerWidth;
this.canv.height = Math.floor(window.innerHeight * 1);
iniciar();
}
iniciar() {
console.log("lo que sea");
}
}