Skip to content

Commit ed11b98

Browse files
author
Santiago Ortiz
committed
git
0 parents  commit ed11b98

File tree

84 files changed

+2785
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+2785
-0
lines changed

clase1 - variables.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html lang="en" dir="ltr">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Clase 1 - Variables</title>
6+
</head>
7+
<body>
8+
<script src="clase1.js"></script>
9+
</body>
10+
</html>

clase1.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
var nombre = 'Sacha', apellido = 'Lifszyc'
2+
var edad = 28
3+
4+
edad = '28 años'
5+
6+
console.log('Hola ' + nombre + ' ' + apellido)
7+
console.log('Tengo ' + edad)
8+
9+
var peso = 75

clase10 - condicionales.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html lang="en" dir="ltr">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Clase 10 - Condicionales</title>
6+
</head>
7+
<body>
8+
<script src="clase10.js"></script>
9+
</body>
10+
</html>

clase10.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
var sacha = {
2+
nombre: 'Sacha',
3+
apellido: 'Lifszyc',
4+
edad: 28,
5+
ingeniero: false,
6+
cocinero: false,
7+
cantante: true,
8+
dj: false,
9+
guitarrista: false,
10+
drone: false
11+
}
12+
13+
function imprimirProfesiones(persona) {
14+
console.log(`${persona.nombre} es:`)
15+
16+
if (persona.ingeniero) {
17+
console.log('Ingeniero')
18+
} else {
19+
console.log('No es ingeniero')
20+
}
21+
22+
if (persona.cocinero) {
23+
console.log('Cocinero')
24+
}
25+
26+
if (persona.dj) {
27+
console.log('DJ')
28+
}
29+
30+
if (persona.cantante) {
31+
console.log('Cantante')
32+
}
33+
34+
if (persona.guitarrista) {
35+
console.log('Gutiarrista')
36+
}
37+
38+
if (persona.drone) {
39+
console.log('Piloto de drone')
40+
}
41+
42+
}
43+
44+
imprimirProfesiones(sacha)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html lang="en" dir="ltr">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Clase 11 - Funciones que retornan valores</title>
6+
</head>
7+
<body>
8+
<script src="clase11.js"></script>
9+
</body>
10+
</html>

clase11.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
var sacha = {
2+
nombre: 'Sacha',
3+
apellido: 'Lifszyc',
4+
edad: 28,
5+
ingeniero: false,
6+
cocinero: false,
7+
cantante: true,
8+
dj: false,
9+
guitarrista: false,
10+
drone: false
11+
}
12+
13+
var juan = {
14+
nombre: 'Juan',
15+
apellido: 'Gomez',
16+
edad: 13
17+
}
18+
19+
function imprimirProfesiones(persona) {
20+
console.log(`${persona.nombre} es:`)
21+
22+
if (persona.ingeniero) {
23+
console.log('Ingeniero')
24+
} else {
25+
console.log('No es ingeniero')
26+
}
27+
28+
if (persona.cocinero) {
29+
console.log('Cocinero')
30+
}
31+
32+
if (persona.dj) {
33+
console.log('DJ')
34+
}
35+
36+
if (persona.cantante) {
37+
console.log('Cantante')
38+
}
39+
40+
if (persona.guitarrista) {
41+
console.log('Gutiarrista')
42+
}
43+
44+
if (persona.drone) {
45+
console.log('Piloto de drone')
46+
}
47+
}
48+
49+
const MAYORIA_DE_EDAD = 18
50+
51+
function esMayorDeEdad(persona) {
52+
return persona.edad >= MAYORIA_DE_EDAD
53+
}
54+
55+
function imprimirSiEsMayorDeEdad(persona) {
56+
if (esMayorDeEdad(persona)) {
57+
console.log(`${persona.nombre} es mayor de edad`)
58+
} else {
59+
console.log(`${persona.nombre} es menor de edad`)
60+
}
61+
}

clase12 - arrow functions.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html lang="en" dir="ltr">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Clase 12 - Arrow functions</title>
6+
</head>
7+
<body>
8+
<script src="clase12.js"></script>
9+
</body>
10+
</html>

clase12.js

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
var sacha = {
2+
nombre: 'Sacha',
3+
apellido: 'Lifszyc',
4+
edad: 28,
5+
ingeniero: false,
6+
cocinero: false,
7+
cantante: true,
8+
dj: false,
9+
guitarrista: false,
10+
drone: false
11+
}
12+
13+
var juan = {
14+
nombre: 'Juan',
15+
apellido: 'Gomez',
16+
edad: 13
17+
}
18+
19+
function imprimirProfesiones(persona) {
20+
console.log(`${persona.nombre} es:`)
21+
22+
if (persona.ingeniero) {
23+
console.log('Ingeniero')
24+
} else {
25+
console.log('No es ingeniero')
26+
}
27+
28+
if (persona.cocinero) {
29+
console.log('Cocinero')
30+
}
31+
32+
if (persona.dj) {
33+
console.log('DJ')
34+
}
35+
36+
if (persona.cantante) {
37+
console.log('Cantante')
38+
}
39+
40+
if (persona.guitarrista) {
41+
console.log('Gutiarrista')
42+
}
43+
44+
if (persona.drone) {
45+
console.log('Piloto de drone')
46+
}
47+
}
48+
49+
const MAYORIA_DE_EDAD = 18
50+
51+
52+
/*** Diferentes Formas de Escribir una funcion (INICIO) ***/
53+
function esMayorDeEdad() {
54+
return persona.edad >= MAYORIA_DE_EDAD
55+
}
56+
57+
const esMayorDeEdad = function(persona) {
58+
return persona.edad >= MAYORIA_DE_EDAD
59+
}
60+
61+
const esMayorDeEdad = (persona) => { // Si se tiene 1 solo parametro, pueden
62+
return persona.edad >= MAYORIA_DE_EDAD // obviarse los () del argumento
63+
}
64+
65+
const esMayorDeEdad = ({ edad }) => edad >= MAYORIA_DE_EDAD // Destructurando Objetos
66+
/*** Diferentes Formas de Escribir una funcion (FIN) ***/
67+
68+
69+
function imprimirSiEsMayorDeEdad(persona) {
70+
if (esMayorDeEdad(persona)) {
71+
console.log(`${persona.nombre} es mayor de edad`)
72+
} else {
73+
console.log(`${persona.nombre} es menor de edad`)
74+
}
75+
}
76+
77+
function permitirAcceso(persona) {
78+
if (!esMayorDeEdad(persona)) {
79+
console.log('ACCESO DENEGADO')
80+
}
81+
}

clase13 - loop for.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html lang="en" dir="ltr">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Clase 13 - Loop for</title>
6+
</head>
7+
<body>
8+
<script src="clase13.js"></script>
9+
</body>
10+
</html>

clase13.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
var sacha = {
2+
nombre: 'Sacha',
3+
apellido: 'Lifszyc',
4+
edad: 28,
5+
peso: 75
6+
}
7+
8+
console.log(`Al inicio del año ${sacha.nombre} pesa ${sacha.peso}kg`)
9+
10+
// function aumentarDePeso (persona) {
11+
// return persona.peso += 200
12+
// }
13+
const INCREMENTO_PESO = 0.2
14+
const DIAS_DEL_ANO = 365
15+
16+
const aumentarDePeso = persona => persona.peso += INCREMENTO_PESO
17+
const adelgazar = persona => persona.peso -= INCREMENTO_PESO
18+
19+
for (var i = 1; i <= DIAS_DEL_ANO; i++) {
20+
var random = Math.random()
21+
22+
if (random < 0.25) {
23+
aumentarDePeso(sacha)
24+
} else if (random < 0.5) {
25+
adelgazar(sacha)
26+
}
27+
}
28+
29+
console.log(`Al final del año ${sacha.nombre} pesa ${sacha.peso.toFixed(1)}kg`)

0 commit comments

Comments
 (0)