You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Algunas veces los arreglos vienen con valores mixtos y debes unificarlos en un solo tipo de datos.
1
+
# `20.4` Map data types
4
2
5
3
## 📝 Instrucciones:
6
4
7
-
1.Actualiza la función `array.map()` para que cree un nuevo arreglo que contenga los tipos de datos de cada elemento correspondiente al arreglo original.
5
+
1.Modifica la función de `array.map()` para que cree un nuevo arreglo que contenga los tipos de datos de cada elemento del arreglo dado.
8
6
9
7
## 💡 Pista:
10
8
11
-
+ Usa la función `typeof` para obtener el tipo de datos
9
+
+ Usa la función `typeof` para obtener el tipo de dato.
The most common scenario for the mapping function is for simplifying given arrays, for example:
3
+
The most common scenario for the mapping function is simplifying given arrays, for example:
4
4
5
5
The current algorithm creates an array with only the names of the people and prints it on the console.
6
6
7
7
## 📝 Instructions:
8
8
9
-
1. Please update the mapping function so it creates an array where each item contains the following:
9
+
1. Please update the `simplifier` function so it creates an array where each item contains the following:
10
10
11
-
```js
11
+
```text
12
12
Hello, my name is Joe and I am 36 years old
13
13
```
14
14
15
-
## Expected result:
15
+
## 💻 Expected result:
16
16
17
17
The result should be similar to this, but the ages might be different.
18
18
@@ -24,12 +24,12 @@ The result should be similar to this, but the ages might be different.
24
24
'Hello, my name is Steve and I am 19 years old' ]
25
25
```
26
26
27
-
## 💡 Hint:
27
+
## 💡 Hints:
28
28
29
-
+ You have to get the age of each people based on their birthDate.
29
+
+ You have to get the age of each person based on their `birthDate`.
30
30
31
-
+ Search in Google "How to get the age of given birth date in javascript".
31
+
+ Search in Google "How to get the age of a given birth date in JavaScript".
32
32
33
-
+ Remember that the age also depends on the month, if the month of the current date is greater than or equal to the current month it adds up to one year".
33
+
+ Remember that the age also depends on the day, if the day of the current date is greater than or equal to the current day, it adds up one more year.
34
34
35
-
+ Inside your simplifier function you have to return a concatenation.
35
+
+ Inside your `simplifier` function you have to return a concatenation.
0 commit comments