Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. function Human(name) {
  2. this.name = name;
  3. }
  4.  
  5. function Employee(name, id){
  6. Human.call(this, name)
  7. this.id = id;
  8. }
  9.  
  10. function Programmer(name, id, progLang) {
  11. Employee.call(this, name);
  12. this.progLang = progLang;
  13. }
  14.  
  15. Human.prototype.changeName = function (name) {
  16. this.name = name;
  17. }
  18.  
  19. Employee.prototype.changeId = function(id) {
  20. this.id = id;
  21. }
  22.  
  23. Programmer.prototype.changeLang = function (progLang) {
  24. this.progLang = progLang;
  25. }
  26.  
  27. inherit(Employee, Human);
  28. inherit(Programmer, Employee);
  29.  
  30. var prog = new Programmer("Ori", 4324324, "JavaScript");
  31. debugger;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement