File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 15
15
- Segundo paso: implementar la fórmulas en JavaScript
16
16
- Tercer paso: crear funciones
17
17
- Cuarto paso: integrar JS con HTML
18
+
19
+ ## Taller #3 : promedio, mediana y moda
20
+
21
+ - Primer paso: definir las fórmulas
22
+ - Segundo paso: implementar la fórmulas en JavaScript
23
+ - Tercer paso: crear funciones
24
+ - Cuarto paso: integrar JS con HTML
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="UTF-8 ">
5
+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
6
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7
+ < title > Promedio</ title >
8
+ </ head >
9
+ < body >
10
+ < header >
11
+ < h1 > Calculando el promedio</ h1 >
12
+ </ header >
13
+
14
+ < script src ="./promedio.js "> </ script >
15
+ </ body >
16
+ </ html >
Original file line number Diff line number Diff line change
1
+
2
+ //Función que calcula el promedio de una array (suma todos sus valores y luego los divide entre su numero de valores.)
3
+ const calculateMiddleArithmetic = ( list ) => {
4
+ const reducer = ( accumulator , currentValue ) => accumulator + currentValue ;
5
+
6
+ const sumList = list . reduce ( reducer ) ;
7
+
8
+ const averageList1 = sumList / list . length ;
9
+ console . log ( averageList1 ) ;
10
+ }
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+ // let sumList1 = 0;
19
+
20
+ // for (let i = 0; i < lista.length; i++) {
21
+ // sumList1 += lista[i];
22
+ // };
23
+ // console.log(sumList1);
You can’t perform that action at this time.
0 commit comments