-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathciclos.js
More file actions
71 lines (54 loc) · 1.1 KB
/
Copy pathciclos.js
File metadata and controls
71 lines (54 loc) · 1.1 KB
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
//CONDICIONES
var a = 5;
var b = 10;
if(a > b){
console.log("a es mayor b")
}else if(a == b){
console.log("a es lo mismo que b")
}else{
console.log("a no es lo mismo que b, y a es menor que b")
}
//CAMBIOS
var dia ="domingo";
switch(dia){
case "sabado":
console.log("no voy a estudiar asp haha ni jsp");
break;
case "martes":
console.log("voy a estudiar CSS");
break;
case "jueves":
console.log("voy a estudiar HTML");
break;
case "domingo":
console.log("voy a descansar");
break;
default: console.log("voy a estudiar javascript");
}
//CICLO FOR
var cajas = document.querySelectorAll(".cajas");
console.log("cajas", cajas);
for(var i=0; i < cajas.length; i++){
cajas[i].style.width = "50px";
cajas[i].style.height = "50px";
cajas[i].style.background = "red";
cajas[i].style.marginTop = "5px";
cajas[i].style.marginRight = "5px";
cajas[i].style.display = "inline-block";
}
for(var i = 1; i <= 5; i++ ){
console.log("i", i);
}
//CICLO WHILE
var n = 1;
while(n <= 5){
console.log("n", n);
n++;
}
//CICLO DO WHILE
var p = 1;
do{
console.log("p", p);
p++;
}
while(p <= 5);