Skip to content

Instantly share code, notes, and snippets.

@snowmantw
Created March 28, 2016 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snowmantw/b0f5961006c11c395cd5 to your computer and use it in GitHub Desktop.
Save snowmantw/b0f5961006c11c395cd5 to your computer and use it in GitHub Desktop.
var Foo = function() {};
Foo.prototype.bark = function() {
console.log('Foo barks');
};
var Bar = function() {};
Bar.prototype = Foo.prototype;
Bar.prototype.bark = function() {
console.log('Bar barks');
};
var foo = new Foo();
var bar = new Bar();
foo.bark();
bar.bark();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment