Skip to content

Instantly share code, notes, and snippets.

@Storyyeller
Last active January 10, 2018 02:39
Show Gist options
  • Save Storyyeller/97447000fbda6f75e73432629a4c3a41 to your computer and use it in GitHub Desktop.
Save Storyyeller/97447000fbda6f75e73432629a4c3a41 to your computer and use it in GitHub Desktop.
function Foo(x) {
this.x = x;
this.y = 432;
}
Foo.prototype.point = function() {
return 'Foo(' + this.x + ', ' + this.y + ')';
}
var myfoo = new Foo(99);
console.log(myfoo.point()); // prints "Foo(99, 432)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment