Alex
3/20/2020 - 8:55 AM

JS base object

BaseObject = function (params, self) {

    params = params || {};

    this.init = function () {
        for (var key in params) {
            if (params.hasOwnProperty(key) && this.hasOwnProperty(key)) {
                this[key] = params[key];
            }
        }
    };

    this.init();
};

var AddListAnswers1 =  function(params) {
    var self = this;

    this.lang = null;

    this.constructor = function() {
        BaseObject.call(self, params);
        console.log(self);
    };

    this.constructor();
};