Say I have the following code:
function MyObject() {
EventTarget.call(this);
}
MyObject.prototype = new EventTarget();
MyObject.prototype.constructor = MyObject;
MyObject.prototype.foo = someFunction;
MyObject.prototype.bar = someOtherFunction
Is there a neat way to avoid defining MyObject.prototype.something = something
in each line.
Do I have to define two objects and merge them? or is there some cleaner way to do the same thing?