document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. function Human(name, age, sex){
  2.    this.name = name;
  3.    this.age = age;
  4.    this.sex = sex;
  5. }
  6.  
  7. Human.prototype.toString = function() {
  8.   return this.name + " is " + this.age + " years old";
  9. }
  10.  
  11. function Superman(name, age, power) {
  12.   this.name = name;
  13.   this.age = age;
  14.   this.power = power;
  15. }
  16. Superman.prototype = new Human();
  17. Superman.prototype.showPower = function() {
  18.   return "Superman can " + this.power;
  19. }
  20.  
  21. var superMan = new Superman(\'Clark Kent\', 30, \'fire laser beam\');
  22. /*
  23. Clark Kent is 30 years old
  24. Superman can fire laser beam
  25. */
  26. console.log(superMan.toString());
  27. console.log(superMan.showPower());
');