-
Notifications
You must be signed in to change notification settings - Fork 4
/
holaMundo.js
51 lines (51 loc) · 1.12 KB
/
holaMundo.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
//primitivas
var name = "Jorge";
var age = 27;
var live = true;
//arrays
var skills = ['Developer', 'Architect Web', 'Teacher'];
var skillsagain = ['Developer', 'Architect Web', 'Teacher'];
var skillnumber = [1, 2, 3, 4];
var skillsnumberagain = [1, 2, 3, 4];
//enums
var Role;
(function (Role) {
Role[Role["Employee"] = 0] = "Employee";
Role[Role["Manager"] = 1] = "Manager";
Role[Role["Admin"] = 2] = "Admin";
})(Role || (Role = {}));
;
//any
var something = 'now as string';
function setHola(name) {
this.hola = "Hola " + name;
}
function print_result() {
document.getElementById('result').innerHTML = getHola();
}
function getHola() {
console.log(this.hola);
return this.hola;
}
function getSomething(data) {
console.log(data);
}
// ES5
function iteradores(data) {
data.forEach(function (iterado) {
console.log(iterado);
});
}
// a lo typescript
function iteradores_ts(data) {
data.forEach(function (iterado) {
return console.log(iterado);
});
;
}
function iteradores_ts2(data) {
data.forEach(function (iterado) {
return console.log(iterado);
});
;
}