I try to inherit in the following way:
function inherits(ctor, base_ctor){
ctor.base = base_ctor;
ctor.prototype = Object.create(base_ctor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true,
}
});
}
function MyClass(){
jQuery.fn.init.call(this,'<form>...</form>');
//...
}
inherits(MyClass, jQuery);
//...
var $my_obj = new MyClass()
and when I try to
$my_obj.find('#id')
it calls constructor of MyClass again (through function jQuery.fn.pushStack())
How to avoid a recursion?
Or how to inherit (not to extend) from jQuery?