Hey there! I'm working on a function within a Point class that adds up the values of X and Y with either Point or individual X and Y parameters.
For example:
public Offset(dx: number, dy: number) {
this.X += dx;
this.Y += dy;
}
public OffsetPoint(p: Point) {
this.X += p.X;
this.Y += p.Y;
}
I was wondering if it's possible to consolidate these two functions into one in TypeScript instead of having separate ones?