class Vector {
constructor(x,y) {
this.x = x || 0;
this.y = y || 0;
}
add = function (c) {
return new Vector(this.x + c.x,this.y+c.y)
};
}
I want to be able to do new Vector(4,4) + new Vector(0,2) --> Vector(4,6). Ive tried changing multiple parts and having a look but closest I found is old ES5 methods.