Handler = function( _options ) {
var that = this;
var options = {
opt1: 'val1',
opt2: 'val2'
};
if(typeof _options === 'object' ) {
options = jQuery.extend( true, options, _options );
}
var go = function() {
alert( options.opt1 );
}
};
Handler2 = function () {
как унаследовать все от Handler ?
var go = function() {
console.log(options.opt2);
}
};
var handler = new Handler2();
handler.go();
var handler = new Handler();
handler.go();
this.go = function () {}
Handler2.prototype = Object.create(Handler.prototype);
Handler2.prototype.constructor = Handler;