Skip to content

Commit 5056c2e

Browse files
committed
ARRAYS: Utilizando sentencias FOR y FOR..OF
1 parent 0e2d2f7 commit 5056c2e

File tree

2 files changed

+25
-42
lines changed

2 files changed

+25
-42
lines changed

Entregas/Entrega2/index.html

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,10 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<link rel="stylesheet" href="./estilos.css" type="text/css">
76
<script async src="./index.js"></script>
8-
<title>ENTREGA 01</title>
7+
<title>ENTREGA 2 ARRAYS</title>
98
</head>
10-
119
<body>
12-
13-
<div id="contenedor">
14-
<div id="central">
15-
<div id="login">
16-
<div class="titulo">
17-
Acceso Usuario
18-
</div>
19-
<form id="loginform">
20-
<input type="text" name="usuario" placeholder="Usuario" required>
21-
22-
<input type="password" placeholder="Contrasena" name="password" required>
23-
24-
<button type="submit" title="Ingresar" name="Ingresar">Login</button>
25-
</form>
26-
<div class="pie-form">
27-
No tienes usuario?<a href="#">Registrate</a>
28-
</div>
29-
</div>
30-
<div class="inferior">
31-
<a href="#">Inicio</a>
32-
</div>
33-
</div>
34-
</div>
10+
<p>ENTREGA 2 : ARRAYS</p>
3511
</body>
3612
</html>

Entregas/Entrega2/index.js

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
11
//SEGUNDA ENTREGA
22
//ARRAY
33

4-
//-------------------------------------------------
5-
//FUNCION ingreso datos
6-
//-------------------------------------------------
7-
/*
8-
function ingreso (){
9-
const lista = [ "Nombre: ", "Apellido: ", "Cedula: " ];
10-
console.log(lista.values); */
4+
/**
5+
* PIDE INGRESAR LOS DATOS DE PERSONAS EN UN ARRAY
6+
*
7+
*/
118

12-
13-
/* for (let value of lista) {
14-
dato = prompt ("Ingrese :");
15-
value += 1;
16-
console.log(value);
17-
}*/
18-
/* }
9+
//CREO MATRIZ
1910

11+
//PIDE INGRESAR LOS DATOS AL ARRAY
2012

13+
let head = ['Nombre', 'Apellido','Cedula'];
14+
let x = head.length; //Cuenta los datos a solicitar (Array "head")
15+
let matriz=[]; //Crea natriz vacia "matriz"
2116

22-
ingreso();
23-
*/
17+
//USANDO FOR
18+
/* for (let i = 0; i < x; i++) {
19+
dato=prompt("Ingrese "+head[i]+": ");
20+
matriz.push([head[i],dato]);
21+
} */
22+
//console.log(matriz);
23+
24+
25+
// USANDO FOR..OF
26+
for (let d of head) {
27+
dato=prompt("Ingrese "+d+": ");
28+
matriz.push([d,dato]);
29+
}
30+
console.log(matriz);

0 commit comments

Comments
 (0)