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 init = function () { | |
| var estudiantes = listaEstudiantes(); | |
| ordenarEstudiantes(estudiantes); | |
| }; | |
| var listaEstudiantes = function () { | |
| var numeroEstudiantes = parseInt(prompt("驴Cu谩ntos estudiantes vas a registrar?")); | |
| var estudiantes = []; |
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
| /* | |
| * Errores de sintaxis | |
| */ | |
| // Nombre de variable con tilde | |
| var n煤mero = 10; | |
| // Error de operador: = es asignaci贸n, mientras, == es comparaci贸n, y, === es comparaci贸n estricta | |
| if (numero = 0) { | |
| console.log("Cero"); |
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
| /* | |
| * Error l贸gico | |
| */ | |
| // Funci贸n que espera 2 n煤meros como par谩metros para devolver la suma de ambos | |
| var suma = function (num1, num2) { | |
| return num1 + num2; | |
| }; | |
| // Imaginemos que el n煤mero 1 es 6 |
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 numero = prompt("Ingrese un n煤mero"); | |
| numero = Number(numero); | |
| if (numero === 0) { | |
| alert("Cero"); | |
| } else if (numero > 0) { | |
| alert("Positivo"); | |
| } else { | |
| alert("Negativo"); | |
| } |
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
| function factorial(numero) { | |
| if (numero === 1) { | |
| return 1; | |
| } | |
| return numero * factorial(numero - 1); | |
| } | |
| var resultado = factorial(5); | |
| console.log(resultado); |
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 numero = parseInt(prompt("Ingresa un n煤mero (del 1 al 10):")); | |
| var numeroAleatorio = Math.floor(Math.random() * 10); | |
| debugger; | |
| if (numeroAleatorio === numero) { | |
| console.log("Adivinaste!"); | |
| } else { | |
| console.log("Perdiste! El n煤mero es " + numeroAleatorio); | |
| } |
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
| /* | |
| * Corrige el siguiente c贸digo de tal forma que obtengas el resultado esperado, | |
| * usa las t茅cnicas de depuraci贸n que conoces para encontrar y solucionar el error. | |
| */ | |
| var revertirTexto = function (texto) { | |
| var textoInvertido = ""; | |
| var longitud = texto.length; | |
| for (var i = longitud; i > 0; i--) { | |
| textoInvertido += texto.charAt(i); |
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
| # Creaci贸n del repositorio | |
| git init | |
| git add -A | |
| git commit -m "Primer commit" | |
| git remote add origin https://github.com/<username>/<nombre-repositorio>.git | |
| git push origin master | |
| # Creaci贸n de rama gh-pages | |
| git checkout -b gh-pages |
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
| # Ingresar a carpeta de proyectos | |
| cd ~/ruta/a/carpeta/de/proyectos | |
| # Crear carpeta de proyecto | |
| mkdir proyecto | |
| cd proyecto | |
| # Creaci贸n de archivos | |
| mkdir css | |
| mkdir js |
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
| # Salir | |
| :q | |
| # Salir sin guardar cambios | |
| :q! | |
| # Guardar cambios | |
| :w | |
| # Guardar cambios y salir |