Skip to content

Commit 2b367f4

Browse files
Balashov NikitaOlegLustenko
authored andcommitted
DONE
1 parent f4470de commit 2b367f4

File tree

1 file changed

+13
-8
lines changed
  • js-core/homeworks/homework-12/src

1 file changed

+13
-8
lines changed

js-core/homeworks/homework-12/src/main.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,27 @@ function Human(object) {
9595
function Worker(object) {
9696
this.company = object.company;
9797
this.salary = object.salary;
98-
this.toWork = function() {
99-
return 'work';
100-
}
98+
10199
Human.call(this, object)
102-
Worker.prototype = new Human(object);
103100
}
104101

102+
Worker.prototype.constructor = Human;
103+
104+
Worker.prototype.toWork = function() {
105+
return 'work';
106+
}
105107

106108
function Student(object) {
107109
this.university = object.university;
108110
this.grants = object.grants;
109-
this.toWatchSeries = function() {
110-
return`watch tv series`;
111-
}
111+
112112
Human.call(this, object)
113-
Student.prototype = new Human(object);
113+
}
114+
115+
Student.prototype.construstor = Human;
116+
117+
Student.prototype.toWatchSeries = function() {
118+
return`watch tv series`;
114119
}
115120

116121
let vasya = new Worker({name: 'Vasya', age: '30', gender: 'Male', height: '1.8 m', weigth: '80 kg', company: 'qwerty', salary: '007'});

0 commit comments

Comments
 (0)