-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclases.js
More file actions
41 lines (30 loc) · 705 Bytes
/
clases.js
File metadata and controls
41 lines (30 loc) · 705 Bytes
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
/* const Rectangle = class R {
} */
class Rectangle {
}
function square(){
}
const r = new Rectangle();
class Circle{
prop = 'my prop';
#ovalo;
static estatica = 21;
constructor(e = 'medio', hambre = false){
this.e = e;
this.#ovalo = hambre
}
imprimir(){
console.log(`Soy un circulo ${this.e} ${this.#ovalo ? 'ovalado' : 'perfectamente circular'}`);
}
static deformar(){
console.log(this.estatica, 'deformado');
}
}
Circle.deformar();
const small = new Circle('pequeño');
//console.log(small.__proto__.imprimir);
//small.imprimir();
const big = new Circle('grande');
//big.imprimir();
const b = new Circle();
//b.imprimir();