Skip to content

Instantly share code, notes, and snippets.

@ashikawa
Last active December 19, 2015 09:19
Show Gist options
  • Save ashikawa/5932157 to your computer and use it in GitHub Desktop.
Save ashikawa/5932157 to your computer and use it in GitHub Desktop.
memo

http://d.hatena.ne.jp/teramako/20130703/p1

class Foo {
    constructor(name) {
        this.name = name;
    }
    hello () {
        console.log("Hello World");
    }
}

var ExFoo = class ExFoo extends Foo {
    constructor(name, bar) {
        super(name);
        tihs.bar = bar;
    }
}
function Foo(name) {
    this.name = name;
}

Foo.prototype.hello = function () {
    console.log("Hello World");
};


var ExFoo = (function () {

    function ExFoo(name, bar) {
        Foo.apply(this, [name]);
        this.bar = bar;
    }

    ExFoo.prototype = new Foo();

    return new ExFoo();
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment