Skip to content
This repository has been archived by the owner on May 15, 2022. It is now read-only.

Commit

Permalink
Atualizado nome e alterado input
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarcon83 committed Mar 11, 2021
1 parent d67adf7 commit 470c601
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@
<script>
let listaDeCoisas = [["frutas"], ["cores"]];

// for (i = 0; i < 6; i++) {
// numeros.frutas.push(prompt("Digite uma fruta. (" + (i + 1) + "/6)"));
// }
listaDeCoisas.frutas = [];
listaDeCoisas.cores = [];

// for (i = 0; i < 8; i++) {
// numeros.frutas.push(prompt("Digite uma cor. (" + (i + 1) + "/8)"));
// }
for (i = 0; i < 6; i++) {
listaDeCoisas.frutas.push(prompt("Digite uma fruta. (" + (i + 1) + "/6)"));
}

for (i = 0; i < 8; i++) {
listaDeCoisas.cores.push(prompt("Digite uma cor. (" + (i + 1) + "/8)"));
}

listaDeCoisas.frutas = ["Maça", "Banana", "Pera", "Uva", "Kiwi", "Caqui"];
listaDeCoisas.cores = ["Vermelho", "Laranja", "Amarelo", "Verde", "Azul", "Rosa", "Preto", "Branco"];
//listaDeCoisas.frutas = ["Maça", "Banana", "Pera", "Uva", "Kiwi", "Caqui"];
//listaDeCoisas.cores = ["Vermelho", "Laranja", "Amarelo", "Verde", "Azul", "Rosa", "Preto", "Branco"];

document.write("Exite Banana na Array? <span>");
listaDeCoisas.frutas.find(item => item == "Banana") ? document.write(" Existe") : document.write(" Não existe");
Expand All @@ -38,7 +41,6 @@
existeAzul ? document.write(" Existe") : document.write(" Não existe");
if (existeAzul)
document.write("</span> e esta no index <span>" + listaDeCoisas.cores.findIndex(item => item == "Azul"))

document.writeln("</span></br>");

document.write("Frutas: <span>");
Expand Down

0 comments on commit 470c601

Please sign in to comment.