javascript - selfish how to call parent initializer -
i'm using selfish javascript library make inheritance in javascript easier. example have 2 objects
var foo = base.extend({ initialize: function(){ this.some_param = 1; } }), bar = base.extend({ initialize: function(){ this.another_param = 2; } });
how call bar initializer foo initializer?
var foo = base.extend({ initialize: function(){ this.some_param = 1; } }), bar = base.extend({ initialize: function(){ foo.initialize.call(this); // <------- here this.another_param = 2; } });
Comments
Post a Comment