forked from profroquefernando/projeto_v1-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathex_arrays_01.html
32 lines (28 loc) · 891 Bytes
/
ex_arrays_01.html
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
<!DOCTYPE html>
<html>
<head>
<title>Aula Lógica de Programação</title>
<meta charset="utf-8">
</head>
<body>
<h1>Lógica de Programação - Arrays</h1>
</body>
<script>
let animais,regiao,especies
especies=""
animais=[
["Alasca","Baleia Jubarte","Foca","Lontra"],
["Deserto do Saara","Escorpião","Dromedário","Lagarto"],
["China","Panda","Faisão Dourado","Urso Asiático"]
]
for(var i=0;i<animais.length;i++){
if(animais[i][0] == "Deserto do Saara"){
regiao=animais[i][0]
for(var n=1;n<animais[i].length;n++){
especies+=`${animais[i][n]} - `
}
}
}
console.log(`Região: ${regiao} - espécies: ${especies}`)
</script>
</html>