I was having issues with a sketch I was working on, so I created this little test to try and narrow down the issue-- which is that this.x
and this.y
are both undefined, even though the Walker
class has a constructor which sets them both to an initial value. Help, what’s going on here?
class Walker{
contructor(){
this.x = 400;
this.y = 400;
}
display(){
console.log(this.x + ", " + this.y);
}
}
let w = new Walker();
w.display(); // prints `undefined, undefined`