Yes, you can modify objects freely. You can modify a particular object Object.overridenProperty = ...
, or modify all objects derived from a given class via its prototype
property Object.prototype.inheritedMethod = ...
.
Have in mind that redefining a method can be tricky, as the new definition won't share the same scope as the original definition:
var BaseClass;
(function(){
var defaults = { ... };
BaseClass = function(){
this.someValue = defaults.someValue;
};
}());
It could also happen that the class definition lies inside a closure and you have no practical way to override a method or property as it is generated JIT. In that case you'd need to override the property at each object you are interested in individually:
(function(){
var defaults = { ... },
BaseObject = (function(){
var obj = function(){
this.someValue = defaults.someValue;
};
return obj;
}());
}());