Apuntes Javascript Intermedio
Nivel Intermedio
JuanMa Garrido
Este libro está a la venta en http://leanpub.com/apuntes-javascript-intermedio
Esta versión se publicó en 2015-01-28
This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing
process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools
and many iterations to get readerfeedback, pivot until you have the right book and build
traction once you do.
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0
Unported License
A mi madre…
“Si tu tonto no eres, lo que pasa es que te tiene que gustar” (mi madre)
Índice general
1. Prologo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1 Referencias . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Agradecimientos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1
1
1
2. Ideas Claras de Javascript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2
3. Breve historia de Javascript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3
4. ECMAScript . . .
4.1EcmaScript 5 .
4.2 EcmaScript 3 .
4.3 EcmaScript 6 .
.
.
.
.
5
5
7
7
5. Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9
6. Primitivas y Tipos de Datos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11
7. Operadores (Aritméticos, Lógicos y de Comparación)
7.1 Operadores Aritméticos . . . . . . . . . . . . . . .
7.2 Operadores Lógicos .. . . . . . . . . . . . . . . .
7.3 Operadores de Comparación . . . . . . . . . . . .
.
.
.
.
13
13
15
16
8. Conversiones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18
9. Condiciones (Bifurcaciones Condicionales) . . . . . . . . . . . . . . . . . . . . . . .
9.1 Condicional if - else . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.2Condicional switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20
20
21
10.Bucles (Loops) . . . .
10.1 El bucle while . .
10.2 El bucle do-while
10.3 El bucle for . . .
10.4 El bucle for-in .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
..
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
..
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
23
23
23
24
25
11.Funciones . . . . . . . . . . . . . . .
11.1 Parametros . . . . . . . . . . . .
11.2 Funciones pre-definidas . . .. .
11.3 Ámbito (Scope) de las Funciones
11.4 Funciones Callback . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
26
26
27
30
30ÍNDICE GENERAL
11.5 Closures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
31
12.Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
34
13.Objetos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13.1 Funciones Constructoras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....
Regístrate para leer el documento completo.