-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathes_new.js
51 lines (40 loc) · 942 Bytes
/
es_new.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"use strict";
// let circlearea = (r) => {
// const PI = 3.14 ;
// return PI * r * r;
// };
//
// let circleArea2 = (r) => 3.14 * r * r;
//
//
// console.log(circleArea2(10));
// Template Literals
//
// let name = "Bucky";
//
// console.log(`This is the white guy
// ${name}`);
// Class
class Person {
constructor(name , age , weight){
this.name = name;
this.age = age;
this.weight = weight;
}
displayWeight(){
console.log(`This is the new ${this.weight} ${this.age} of the ${this.name}`);
}
}
class Programmer extends Person {
constructor(name , age , weight , language){
super(name, age, weight);
this.language = language;
}
getLanguage(){
console.log(`My langualge is ${this.language}`);
}
}
let bucky = new Programmer('Buka' , 87 , 567, 'java');
let sala = new Person('Sally' , 7 , 56);
bucky.displayWeight();
sala.displayWeight();