This file contains 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
numeros = [1, 2, 3, 4, 5, 6, 7, 8, 9] | |
texto = ["perro", "gato", "caballo"] | |
mix = [1, "casa", "auto", 77 ] | |
// Sus índices comienzan en 0 y se invocan con el nombre de la variable seguido del número de la posición entre corchetes. | |
console.log(numeros[1]) // 2 | |
console.log(texto[0]) // perro | |
console.log(mix[3]) // 77 |
This file contains 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
/////////////1º | |
// if (3>4) { | |
// console.log("3 es menor que 4"); | |
// } | |
// var edad = 17; |
This file contains 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 myFuncion() { | |
// return 3 + 4; | |
// } | |
// console.log(myFuncion()); // 7 | |
// function myFuncion(a, b) { |
This file contains 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 myFuncion() { | |
// return 3 + 4; | |
// } | |
// console.log(myFuncion()); // 7 | |
function myFuncion(a, b) { |
This file contains 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
const a = 7; | |
a = 8; // reasignación | |
console.log(a);// TypeError: Assignment to constant variable. | |
let b = 7; // mismo resultado para var a = 7 | |
b = 9; | |
console.log(b); // 9 var y let pueden ser reasignadas |
This file contains 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
a = 5; | |
b = "hola"; | |
console.log(a); // 5 | |
console.log(b); // hola | |
console.log(a, b); // 5 hola | |
console.log(b, a); // hola 5 | |
console.log(a, a); // 5 5 | |
console.log(b, b); // hola hola |
This file contains 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
<!DOCTYPE html> | |
<html lang="es"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Positions</title> | |
<style> | |
.elemento { | |
background-color: coral; | |
border: 5px solid purple; |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Flexbox</title> | |
<style> | |
.contenedor { | |
/* display: flex; */ | |
/* flex-direction: column; */ | |
/* justify-content: space-between; */ |
This file contains 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
<!DOCTYPE html> | |
<html lang="es"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Página 2</title> | |
</head> | |
<body> | |
<h1>Esta es la página pagina2.html</h1> | |
</body> | |
</html> |
This file contains 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
<!DOCTYPE html> | |
<html lang="es"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Links</title> | |
</head> | |
<body> | |
<a href="pagina2.html">Ir a página 2</a> | |
<br> | |
<a href="pagina2.html" target="_blank">Ir a página 2</a> |