fork download
  1. var testParent = {
  2. 'testMethod' : function () {print('a');}
  3. };
  4.  
  5. function testClass() {}
  6. testClass.prototype = testParent;
  7. var testInstance = new testClass();
  8. testInstance.testMethod();
  9. testParent.testMethod = function() {print('b');};
  10. testInstance.testMethod();
Success #stdin #stdout 0.02s 30320KB
stdin
Standard input is empty
stdout
a
b