Created
May 30, 2017 05:12
-
-
Save itzsaga/7b9adbadf9f2b148142dbc0acd01d5a0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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