We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 057f96e commit 83b6f69Copy full SHA for 83b6f69
1 file changed
js-structure/map_method/map-for.js
@@ -0,0 +1,28 @@
1
+const users = [
2
+ {
3
+ id: 9,
4
+ nome: "Iago Pedrosa",
5
+ },
6
7
+ id: 16,
8
+ nome: "Gabriel Azevedo",
9
10
11
+ id: 14,
12
+ nome: "Cleslley de Moura",
13
14
15
+ id: 15,
16
+ nome: "Maria Clara",
17
18
+];
19
+
20
+const lista = [];
21
+// lembrando que:
22
+// (incialização; condição; incremento/decremento)
23
+for (let i = 0; i < users.length; i++) {
24
+ lista.push(users[i].nome);
25
+ // lista recebe o array de (users[posição do index no array].item que você quer chamar)
26
+}
27
28
+console.log(lista);
0 commit comments