RsD0p9BK
7/7/2017 - 6:36 AM

js__class_with_init.js

var Human = function Human(a, b) {
    function Human(a, b) {
        this.a = a;
        this.b = b;
        this.test2 = function () {
            console.log('test2: ' + this.a);
            return this;
        };
    }
    return Human;
}();

    Human.prototype.test1 = function () {
        console.log('test1: ' + this.b);
        return this;
    };

var ivan = new Human(12, 5);

ivan.test1();
ivan.test2();