-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
82 lines (72 loc) · 2.07 KB
/
Copy pathindex.html
File metadata and controls
82 lines (72 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript">
// Metodos basicamente son funciones
// Dos tipos de funciones:
// - Funciones con Retorno
// - Funciones de ejecucion
// Funciones con retorno:
// Devuelven un resultado almacenable
// - Guardar lo que procesa esa funcion dentro de una variable
// f(x) = x + 1
// x = 1 -> Nuestra funcion f(1) = 1 + 1 -> f(1) = 2
// El resultado almacenable es "2"
let f_x = function (x){
return x + 1
}
// Voy a invocar la funcion f_x(1)
let grafico = f_x(1)
// f(1) = 1 + 1 = 2
console.log("grafico :: ", grafico)
// PROBLEMA FUNCION SUMA
// Suma = a + b
// 2 + 5 = 7
let suma = function (a,b){
return a + b
}
let resutlado = suma(2, 5)
console.log("Resultado suma :: ", resutlado)
// PROBLEMA: Funcion de ejecucion
// La funcion despliegue mi nombre en la consola
let muestraNombre = function (){
let nombre = "Alex Casadevall"
console.log("Mi nombre :: ", nombre)
}
// Ejecutar la funcion en el codigo
muestraNombre()
// Est. de Datos
// Arrays y objetos
// Objetos
// - Abstraer conceptos reales en propiedades y valores
// Quiero hacer un software para almacenar usuarios
// Tengo que definir que es un usuario para mi software
// - Cond. necesarias y suficientes para que usuario este representado en el sistema
// - Obj del sistema
// Obj. del sistema: Sistema de proveedores
// Usuario: (nombre, direccion, RUT, telefono, email, razonSocial)
let usuario = {
nombre: "Alex",
direccion: "Arenal Grande",
rut: "23123213213",
telefono: 200000,
email: "alex@lexartlabs.com",
razonSocial: "LEXART LABS SRL"
}
// PROBLEMA: Sistema para veterinarias
// Cond. necesaria y suficiente para una mascota
// mascota: (nombre, tipo, raza, matricula, edad, vacunas)
let mascota = {
nombre: "Bobby",
tipo: "perro",
raza: "Border Colie",
matricula: 123213213,
edad: 8,
vacunas: 4
}
</script>
</body>
</html>