fork download
  1. function Dog (name) {
  2. this.name = name;
  3. }
  4.  
  5. Dog.prototype.walk = function () {
  6. print(this.name + " is walking with four legs!");
  7. };
  8.  
  9. var john = new Dog("John");
  10. john.walk();
Success #stdin #stdout 0.01s 4940KB
stdin
Standard input is empty
stdout
John is walking with four legs!