-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathretosProgramacionFuncional.js
More file actions
56 lines (54 loc) · 1.09 KB
/
Copy pathretosProgramacionFuncional.js
File metadata and controls
56 lines (54 loc) · 1.09 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
const getNestedRecordsExample = () => [
{
id: 1,
nombre: 'Camila Lopez',
detalles: {
descripcion: 'matricula normal',
contacto: {
email: 'clopez@mail.com',
telefono: 83242834
},
valorMatricula: 200000
},
},
{
id: 2,
nombre: 'Pedro Perez',
detalles: {
descripcion: 'beca',
contacto: {
email: 'pperez@mail.com',
telefono: 83242834
},
valorMatricula: 0
},
},
{
id: 3,
nombre: 'Juan Yarce',
detalles: {
descripcion: 'matricula normal',
contacto: {
value: 'jyarce@mail.com',
telefono: 1122334455
},
valorMatricula: 400000
},
},
{
id: 3,
nombre: 'Alberto Benitez',
detalles: {
descripcion: 'matricula condicional',
contacto: {
value: 'abenitez@mail.com',
telefono: 234534566
},
valorMatricula: 600000
},
},
];
const estudiantes = getNestedRecordsExample().reduce(
(a,b) => a + b.detalles.valorMatricula, 0
)
console.log(estudiantes)