-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexercicio7.js
More file actions
34 lines (26 loc) · 741 Bytes
/
exercicio7.js
File metadata and controls
34 lines (26 loc) · 741 Bytes
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
/*Crie um array chamado família e nesse array salve 3 objetos.
Cada objeto deve ter algumas informações de alguém da família: nome, idade, corPreferida (...).
Por fim, crie uma função que utilize estruturas de repetição (for ou while) para varrer o array família e exibir no console as informações dos objetos.*/
const familia = [
{
nome: "Auanny",
idade: 28,
corPreferida: "Amarelo",
},
{
nome: "Duda",
idade: 51,
corPreferida: "Verde",
},
{
nome: "Bruna",
idade: 24,
corPreferida: "Azul",
}
]
// Cor preferida
for (let i = 0 ; i < familia.length ; i ++) {
let nome = familia[i];
if(nome.corPreferida) {
}
}