Skip to content

Instantly share code, notes, and snippets.

@Storyyeller
Created December 28, 2017 05:19
Show Gist options
  • Save Storyyeller/9825b8edf07113bbfa53b11b8b5ace91 to your computer and use it in GitHub Desktop.
Save Storyyeller/9825b8edf07113bbfa53b11b8b5ace91 to your computer and use it in GitHub Desktop.
class Base {
foo() {return 'foo in Base';}
bar() {return 'bar in Base';}
}
class Child extends Base {
foo() {return 'foo in Child';}
whiz() {return 'whiz in Child';}
}
const b = new Base;
const c = new Child;
console.log(b.foo()); // foo in Base
console.log(b.bar()); // bar in Base
console.log(c.foo()); // foo in Child
console.log(c.bar()); // bar in Base
console.log(c.whiz()); // whiz in Child
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment