Skip to content

Instantly share code, notes, and snippets.

@itzsaga
Created May 30, 2017 05:12
Show Gist options
  • Select an option

  • Save itzsaga/7b9adbadf9f2b148142dbc0acd01d5a0 to your computer and use it in GitHub Desktop.

Select an option

Save itzsaga/7b9adbadf9f2b148142dbc0acd01d5a0 to your computer and use it in GitHub Desktop.
function Point (x, y) {
this.x = x
this.y = y
}
Point.prototype.toString = () => {
return `(${this.x}, ${this.y})`
}
// In the terminal
> var p = new Point(2,3)
undefined
> p
Point { x: 2, y: 3 }
> p.toString()
'(undefined, undefined)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment