Created
March 1, 2017 16:46
-
-
Save ivandevp/445c017e7adf60ba71842b2537f6dbdb to your computer and use it in GitHub Desktop.
Creación de arreglo de objetos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var numeroEstudiantes = parseInt(prompt("Dame el # de estudiantes")); | |
| var estudiantes = []; | |
| for (var i = 0; i < numeroEstudiantes; i++) { | |
| var nombre = prompt("Ingresa el nombre " + i); | |
| var apellidos = prompt("Ingresa el apellido " + i); | |
| var estudiante = {}; | |
| estudiante.nombre = nombre; | |
| estudiante.apellidos = apellidos; | |
| estudiantes.push(estudiante); | |
| } | |
| console.log(estudiantes); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment