-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.js
92 lines (92 loc) · 2.14 KB
/
main.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
"use strict";
(() => {
let superMan = {
id: 12254,
name: 'Clark Kent',
age: 60,
powers: ['Super fuerza'],
getName() {
return this.name;
}
};
})();
(() => {
class Soda {
constructor(flavor, sugar, price) {
this.flavor = flavor;
this.sugar = sugar;
this.price = price;
}
createFlavor(name) {
console.log(`Nuevo sabor ${name} en creación`);
}
}
const coke = new Soda("Vainilla", 500, 15800);
const fanta = new Soda("Vainilla", 500, 15800);
coke.createFlavor("Chocolate");
console.log(fanta.price);
})();
(() => {
const client = {
name: 'Manuel',
age: 20,
address: {
id: 212,
zip: '20201',
city: 'San Ramón'
},
getFullAddress(id) {
return this.address.zip;
}
};
})();
(() => {
const conducirBatimovil = (auto) => {
auto.encender = true;
auto.velocidadMaxima = 100;
auto.acelear();
};
const batimovil = {
encender: false,
velocidadMaxima: 0,
acelear() {
console.log("...... gogogo!!!");
}
};
const guason = {
reir: true,
comer: true,
llorar: false
};
const reir = (guason) => {
if (guason.reir) {
console.log("JAJAJAJA");
}
};
const ciudadGotica = (ciudadanos) => {
return ciudadanos.length;
};
let Gender;
(function (Gender) {
Gender["F"] = "Femenino";
Gender["M"] = "Masculino";
})(Gender || (Gender = {}));
class Persona {
constructor(nombre, edad, sexo, estadoCivil) {
this.nombre = nombre;
this.edad = edad;
this.sexo = sexo;
this.estadoCivil = estadoCivil;
}
imprimirBio() {
console.log(`${this.nombre} - ${this.edad} - ${this.estadoCivil}`);
}
}
})();
(() => {
const addNumbersFunction = (a, b) => {
return a + b;
};
console.log(addNumbersFunction(5, 5));
})();
//# sourceMappingURL=main.js.map