Skip to content

Instantly share code, notes, and snippets.

@sean9999
Created December 10, 2016 23:06
Show Gist options
  • Select an option

  • Save sean9999/708ab36abf6e9dcddd6d2dd2b4024a44 to your computer and use it in GitHub Desktop.

Select an option

Save sean9999/708ab36abf6e9dcddd6d2dd2b4024a44 to your computer and use it in GitHub Desktop.

Revisions

  1. sean9999 created this gist Dec 10, 2016.
    35 changes: 35 additions & 0 deletions so 41080980.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@


    class First {
    constructor() {
    this.loc = '1';
    }
    test() {
    console.log('first', this.loc);
    }
    }

    class Second extends First {
    constructor() {
    super();
    this.loc = '2';
    }
    test() {
    console.log('second',this.loc);
    super.test();
    }
    }

    class Third extends Second {
    constructor() {
    super();
    this.loc = '3';
    }
    test() {
    console.log('third',this.loc);
    super.test();
    }
    }

    let t = new Third();
    t.test();