{"id":1428,"date":"2024-10-05T21:55:47","date_gmt":"2024-10-06T00:55:47","guid":{"rendered":"https:\/\/desvendandoocodigo.com.br\/?p=1428"},"modified":"2024-10-05T22:00:26","modified_gmt":"2024-10-06T01:00:26","slug":"resumo-da-live-tiktok-05-10-2024","status":"publish","type":"post","link":"https:\/\/desvendandoocodigo.com.br\/?p=1428","title":{"rendered":"Resumo da Live TikTok 05\/10\/2024"},"content":{"rendered":"\n<p>Ol\u00e1 Pessoal! <\/p>\n\n\n\n<p>Na Live do dia 05\/10\/2024  criamos um CRUD com vetor e trabalhamos com m\u00f3dulos.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SCRIPT.JS\n\nconst prompt = require('prompt-sync')();\n\n\/\/CONSTRUCAO DO VETOR GLOBAL\nlet hamburgueria = &#91;];\n\n\/\/FUNCAO PARA EXIBIR O MENU\n\nfunction exibirMenu(){\n    console.log(\"\\n Menu da hamburgueria \");\n    console.log(\"1. Adicionar Hamb\u00farguer \");\n    console.log(\"2. Ver Hamb\u00fargueres\");\n    console.log(\"3. Atualizar Hamb\u00farguer \");\n    console.log(\"4. Deletar  Hamb\u00farguer\");\n    console.log(\"5. Sair \");\n}\n\n\/\/ADICIONAR\nfunction adicionarHamburguer(){\n    const nome  = prompt('Nome do hamb\u00farguer: ');\n    const preco = prompt('Pre\u00e7o do hamb\u00farguer: ');\n    hamburgueria.push( { nome, preco } );\n    console.log(\"Hamb\u00farguer adicionado com sucesso!\");\n}\n\n\/\/LISTAR\nfunction verHamburgueres(){\n    if(hamburgueria.length === 0){\n        console.log(\"Nenhum Hamb\u00farguer encontrado!\");\n        return;\n    }\n    console.log(\"\\n Lista de Hamb\u00fargueres: \");\n    hamburgueria.forEach( ( hamburguer, index)=>{\n        console.log(`${index + 1 }. Nome: ${hamburguer.nome}, Pre\u00e7o: R$${hamburguer.preco}`);\n    });\n}\n\n\/\/ATUALIZAR\nfunction atualizarHamburguer(){\n    verHamburgueres();\n    const index = parseInt(prompt('Escolha o n\u00famero do hamb\u00farguer'+\n        'para atualizar ')) - 1;\n    \n    if(index &lt; 0 || index >= hamburgueria.length){\n        console.log('N\u00famero inv\u00e1lido.');\n        return;\n    }\n    const novoNome = prompt(\"Novo nome do hamb\u00farguer: \");\n    const novoPreco = prompt(\"Novo pre\u00e7o do hamb\u00farguer: \");\n    hamburgueria&#91;index] = { nome: novoNome, preco: novoPreco};\n    console.log('Hamb\u00farguer atualizado com sucesso!');\n\n}\n\/\/DELETAR\nfunction deletarHamburguer(){\n    verHamburgueres();\n    const index = parseInt(prompt('Escolha o n\u00famero do hamb\u00farguer'+\n        ' para deletar ')) - 1;\n\n    if(index &lt; 0 || index >= hamburgueria.length){\n        console.log('N\u00famero inv\u00e1lido.');\n        return;\n    }\n    hamburgueria.splice(index, 1);\n    console.log('Hamb\u00farguer deletado com sucesso!');\n}\n\n\nmodule.exports = {\n\n    prompt,\n    exibirMenu,\n    adicionarHamburguer,\n    verHamburgueres,\n    atualizarHamburguer,\n    deletarHamburguer\n\n\n }\n\n\n\nMENU.JS\n\nconst {\n    prompt,\n    exibirMenu,\n    adicionarHamburguer,\n    verHamburgueres,\n    atualizarHamburguer,\n    deletarHamburguer\n\n} = require('.\/script');\n\nfunction principal(){\n\n    let opcao;\n    do {\n        exibirMenu();\n\n        opcao = parseInt(prompt(\"Escolha uma op\u00e7\u00e3o: \"));\n        switch(opcao){\n            case 1:\n            adicionarHamburguer();\n            break;\n\n            case 2:\n            verHamburgueres();\n            break;\n\n            case 3:\n            atualizarHamburguer();\n            break;\n\n            case 4:\n            deletarHamburguer();\n            break;\n\n            case 5:\n                console.log(\"Saindo...\");\n            break;\n\n            default:\n                console.log(\"Op\u00e7\u00e3o inv\u00e1lida. Tente novamente. \");\n            break;\n\n         }\n    }while (opcao !== 5)\n        \n\n\n}\n\nprincipal();\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"321\" src=\"https:\/\/desvendandoocodigo.com.br\/wp-content\/uploads\/2024\/01\/hotmart.png\" alt=\"\" class=\"wp-image-162\" style=\"width:134px;height:auto\" srcset=\"https:\/\/desvendandoocodigo.com.br\/wp-content\/uploads\/2024\/01\/hotmart.png 1000w, https:\/\/desvendandoocodigo.com.br\/wp-content\/uploads\/2024\/01\/hotmart-300x96.png 300w, https:\/\/desvendandoocodigo.com.br\/wp-content\/uploads\/2024\/01\/hotmart-768x247.png 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><a href=\"https:\/\/go.hotmart.com\/V89811082M?dp=1\">https:\/\/go.hotmart.com\/V89811082M?dp=1<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/go.hotmart.com\/X90111663X?dp=1\">https:\/\/go.hotmart.com\/X90111663X?dp=1<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>HOR\u00c1RIO DAS LIVES<\/strong><\/p>\n\n\n\n<p>Domingo e Segunda \u00e0s 19:00hs (Somente nesse domingo 06\/10\/2024 n\u00e3o teremos Live.)<\/p>\n\n\n\n<p>Quarta \u00e0s 18:00hs<\/p>\n\n\n\n<p>Quinta e Sexta \u00e0s 10:00hs<\/p>\n\n\n\n<p> S\u00e1bado \u00e0s 20:00hs<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Programa\u00e7\u00e3o do zero ao avan\u00e7ado |  #cursodejavascript\" width=\"960\" height=\"540\" src=\"https:\/\/www.youtube.com\/embed\/m5WLUQAZ0vA?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Ol\u00e1 Pessoal! Na Live do dia 05\/10\/2024 criamos um CRUD com vetor e trabalhamos com m\u00f3dulos. https:\/\/go.hotmart.com\/V89811082M?dp=1 https:\/\/go.hotmart.com\/X90111663X?dp=1 HOR\u00c1RIO DAS LIVES Domingo e Segunda \u00e0s 19:00hs (Somente nesse domingo 06\/10\/2024 n\u00e3o teremos Live.) Quarta \u00e0s 18:00hs Quinta e Sexta \u00e0s 10:00hs S\u00e1bado \u00e0s 20:00hs<\/p>\n","protected":false},"author":1,"featured_media":1097,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[18],"tags":[],"_links":{"self":[{"href":"https:\/\/desvendandoocodigo.com.br\/index.php?rest_route=\/wp\/v2\/posts\/1428"}],"collection":[{"href":"https:\/\/desvendandoocodigo.com.br\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/desvendandoocodigo.com.br\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/desvendandoocodigo.com.br\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/desvendandoocodigo.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1428"}],"version-history":[{"count":3,"href":"https:\/\/desvendandoocodigo.com.br\/index.php?rest_route=\/wp\/v2\/posts\/1428\/revisions"}],"predecessor-version":[{"id":1433,"href":"https:\/\/desvendandoocodigo.com.br\/index.php?rest_route=\/wp\/v2\/posts\/1428\/revisions\/1433"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/desvendandoocodigo.com.br\/index.php?rest_route=\/wp\/v2\/media\/1097"}],"wp:attachment":[{"href":"https:\/\/desvendandoocodigo.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/desvendandoocodigo.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/desvendandoocodigo.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}