-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathscript.js
More file actions
31 lines (27 loc) · 961 Bytes
/
script.js
File metadata and controls
31 lines (27 loc) · 961 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
//const listagemDeFrutas = ["Uva", "Banana", "Manga", "Cajá", "Pinha", "Maçã", "Melão"];
// for (let fruta = 0; fruta < listagemDeFrutas.length; fruta++){
// console.log(listagemDeFrutas[fruta]);
// }
//*FRUTA É UM INDEX
// DEVEMOS SEMPRE NOMEAR O INDEX
//ECERCICIO DE CASA
//const usuarios = [
// {user: 234, name: 'Marcia', idade: 40 },
// {user: 235, name: 'Lorena', idade: 20 },
// {user: 236, name: 'Patricia', idade: 24 },
// {user: 237, name: 'Mariana', idade: 15 },
// {user: 238, name: 'Isis', idade: 34 },
//{user: 239, name: 'Pietra', idade: 23 }
//]
//um jeito
//for (let contador = 0; contador < usuarios.length ; contador++) {
// if (usuarios[contador].user === 235) {
// console.log(usuarios[contador].name, usuarios[contador].idade);
// }
//}
// outro jeito
//for (let contador of usuarios) {
// if(contador.user === 235) {
// console.log(contador.name, contador.idade);
//}
//}