-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclase25.js
More file actions
37 lines (29 loc) · 994 Bytes
/
clase25.js
File metadata and controls
37 lines (29 loc) · 994 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
class Persona {
constructor(nombre, apellido, estatura) {
this.nombre = nombre
this.apellido = apellido
this.estatura = estatura
}
saludar(){
console.log(`Hola, me llamo ${this.nombre} ${this.apellido}`);
}
soyAlto(){
return this.estatura > 1.70
}
}
class Desarrollador extends Persona {
constructor(nombre, apellido, estatura) {
super(nombre, apellido, estatura)
}
/**
constructor(nombre, apellido, estatura, tiempo){
super(nombre,apellido,estatura);
this.nombre_desarrollador = nombre; // Atributo heredado nombre guardado en un atributo nuevo.
this.apellido_desarrollador = apellido; // Atributo heredado apellido guardado en un atributo nuevo.
this.estatura_desarrollador = estatura; // Atributo heredado estatura guardado en un atributo nuevo.
this.tiempo_de_desarrollador = tiempo; // Nuevo atributo
**/
saludar(){
console.log(`Hola, me llamo ${this.nombre} ${this.apellido} y soy desarrollador`);
}
}