fork download
  1. var MyClass = function() {};//親クラス宣言?
  2. MyClass.prototype = {
  3. printTest : function() {//メソッド?
  4. print("test");
  5. }
  6. };
  7.  
  8. var MySonClass = function() {};//子クラス宣言?
  9. MySonClass.prototype = new MyClass();//継承?
  10. MySonClass.prototype.name='MySon';//メンバ変数?
  11. MySonClass.prototype.printName=function() {//メソッド?
  12. print(this.name);
  13. }
  14. var myInstance = new MySonClass();
  15. myInstance.printTest();
  16. myInstance.printName();
Success #stdin #stdout 0.28s 213248KB
stdin
Standard input is empty
stdout
test
MySon