How do I remove the property p
from the object's prototype?
var Test = function() {};
Object.defineProperty(Test.prototype, 'p', {
get: function () { return 5; }
});
Object.defineProperty(Test.prototype, 'p', {
get: function () { return 10; }
});
This produces TypeError: Cannot redefine property: p. Is there a way I can remove the property and re-add it? Or is it possible to set the configurable
attribute after the property was created?