Skip to content

Instantly share code, notes, and snippets.

@CertainLach
Created February 6, 2017 19:15
Show Gist options
  • Save CertainLach/b0bf36c7b8edbe98ad5404b5e94135ef to your computer and use it in GitHub Desktop.
Save CertainLach/b0bf36c7b8edbe98ad5404b5e94135ef to your computer and use it in GitHub Desktop.

Motivation

  • To replace some methods of class on creation instead on creating addictional class

Example

class A {
  b() {
    return 3;
  }
}
let aO=new A();
aO.b(); //3
let aR=new A(){
  b() {
    return 4;
  }
}
aO.b(); //4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment