We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef92b77 commit 64f6c0dCopy full SHA for 64f6c0d
1 file changed
ES6/Inheritance/main.js
@@ -8,6 +8,14 @@ class Person{
8
this.weight = weight;
9
}
10
11
+ displayName(){
12
+ console.log(this.name);
13
+ }
14
+
15
+ displayAge(){
16
+ console.log(this.age);
17
18
19
displayWeight(){
20
console.log(this.weight)
21
@@ -21,22 +29,19 @@ class Programmer extends Person{
29
this.language = language;
22
30
23
31
24
- displayAge(){
25
- console.log(this.age);
26
- }
27
-
28
32
displayLanguage(){
33
console.log(this.language);
34
35
36
37
38
let sally = new Person('Sally Jones', 21, 89);
39
+sally.displayName();
40
+sally.displayAge();
41
sally.displayWeight();
42
43
console.log('----------');
44
45
let bucky = new Programmer('Bucky Roberts', 87, 250, 'JavaScript');
-bucky.displayWeight();
-bucky.displayAge();
46
+bucky.displayName();
47
bucky.displayLanguage();
0 commit comments