Skip to content

Instantly share code, notes, and snippets.

@arjunguha
Created October 22, 2018 01:57
Show Gist options
  • Save arjunguha/5b3fc46636a6dd989d4d3b33798bb7a7 to your computer and use it in GitHub Desktop.
Save arjunguha/5b3fc46636a6dd989d4d3b33798bb7a7 to your computer and use it in GitHub Desktop.
class Point {
constructor(x, y) {
this.x = x;
this.y = y;
}
}
class PointBuilder {
constructor() {
this.x = 0;
this.y = 0;
}
setX(x) {
this.x = x;
}
setY(y) {
this.y = y;
}
build() {
return new Point(x, y);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment