0

Originally I had it as, the error was that c was undefined.

constructor(c){
        this.x = c.x || 0;
        this.y = c.y || 0;
        ...
}

I tried doing this as well (as suggested by the answer to this question), the error is that the values always get set to default.

constructor({
        x = 0,
        y = 0
        } = {}){
        this.x = x;
        this.y = y;
        ...
}

Link to Github repo

0 Answers0