{"id":1299,"date":"2012-12-17T12:31:34","date_gmt":"2012-12-17T12:31:34","guid":{"rendered":"http:\/\/leonardocotta.com.br\/blog\/?p=1299"},"modified":"2012-12-17T12:31:34","modified_gmt":"2012-12-17T12:31:34","slug":"como-remover-um-indice-de-um-array","status":"publish","type":"post","link":"https:\/\/leonardocotta.com.br\/?p=1299","title":{"rendered":"Como remover um \u00edndice de um Array"},"content":{"rendered":"<p>jQuery Brasil<\/p>\n<p style=\"color:#000000;font-family:arial, sans-serif;font-size:13px;line-height:normal;background-color:#ffffff;\">H\u00e1 alguns dias atr\u00e1s, precisei remover um \u00edndice de um\u00a0<code style=\"font-size:11px;\">array<\/code>\u00a0e por um instante fiquei sem saber o que fazer, mas logo um\u00a0<a style=\"color:#1155cc;\" title=\"amigo\" href=\"https:\/\/www.google.com.br\/\" target=\"_blank\" rel=\"noopener\">amigo<\/a>\u00a0me ajudou me dando a dica que no\u00a0<strong>JavaScript<\/strong>\u00a0os\u00a0<code style=\"font-size:11px;\">arrays<\/code>\u00a0possuem um m\u00e9todo chamado<a style=\"color:#1155cc;\" title=\"Splice\" href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/JavaScript\/Reference\/Global_Objects\/Array\/splice\" target=\"_blank\" rel=\"noopener\">Splice<\/a>, neste post vou explicar este m\u00e9todo do\u00a0<a style=\"color:#1155cc;\" title=\"JavaScript\" href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/JavaScript\" target=\"_blank\" rel=\"noopener\">JavaScript<\/a>\u00a0e como usa-lo de forma inteligente com um outro m\u00e9todo do\u00a0<a style=\"color:#1155cc;\" title=\"jQuery\" href=\"http:\/\/jquery.com\/\" target=\"_blank\" rel=\"noopener\">jQuery<\/a>.<\/p>\n<h2 style=\"color:#000000;font-family:arial, sans-serif;line-height:normal;background-color:#ffffff;\">O que o m\u00e9todo Splice faz?<\/h2>\n<p style=\"color:#000000;font-family:arial, sans-serif;font-size:13px;line-height:normal;background-color:#ffffff;\">O m\u00e9todo\u00a0<code style=\"font-size:11px;\">splice<\/code>, em portugu\u00eas \u00e9 algo como \u201cemendar\u201d ou \u201cjuntar\u201c, ele altera os \u00edndices de um\u00a0<code style=\"font-size:11px;\">array<\/code>\u00a0enquanto adiciona novos \u00edndices ao\u00a0<a style=\"color:#1155cc;\" title=\"Array\" href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/JavaScript\/Reference\/Global_Objects\/Array\" target=\"_blank\" rel=\"noopener\">array<\/a>\u00a0em quest\u00e3o.<br \/>\nUm exemplo bem pr\u00e1tico seria:<\/p>\n<pre style=\"font-size:11px;color:#000000;line-height:normal;background-color:#ffffff;\">var arr = [0, 1, 2, 3, 4, 5]; \narr.splice(1, 0, 'a', 'b');\n\/\/ agora o arr \u00e9: [0, \"a\", \"b\", 1, 2, 3, 4, 5]<\/pre>\n<h2 style=\"color:#000000;font-family:arial, sans-serif;line-height:normal;background-color:#ffffff;\">Como usar o m\u00e9todo Splice<\/h2>\n<p>via<a href=\"http:\/\/feedproxy.google.com\/~r\/JqueryBrasil\/~3\/1Zl6oSALaOI\/\">Como remover um \u00edndice de um Array<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>jQuery Brasil H\u00e1 alguns dias atr\u00e1s, precisei remover um \u00edndice de um\u00a0array\u00a0e por um instante fiquei sem saber o que fazer, mas logo um\u00a0amigo\u00a0me ajudou me dando a dica que no\u00a0JavaScript\u00a0os\u00a0arrays\u00a0possuem um m\u00e9todo chamadoSplice, neste post vou explicar este m\u00e9todo do\u00a0JavaScript\u00a0e como usa-lo de forma inteligente com um outro m\u00e9todo do\u00a0jQuery. O que o m\u00e9todo &hellip; <a href=\"https:\/\/leonardocotta.com.br\/?p=1299\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Como remover um \u00edndice de um Array<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[42,44],"tags":[166,246],"class_list":["post-1299","post","type-post","status-publish","format-standard","hentry","category-javascript","category-jquery","tag-jquery","tag-splice"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/leonardocotta.com.br\/index.php?rest_route=\/wp\/v2\/posts\/1299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/leonardocotta.com.br\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/leonardocotta.com.br\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/leonardocotta.com.br\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/leonardocotta.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1299"}],"version-history":[{"count":0,"href":"https:\/\/leonardocotta.com.br\/index.php?rest_route=\/wp\/v2\/posts\/1299\/revisions"}],"wp:attachment":[{"href":"https:\/\/leonardocotta.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/leonardocotta.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/leonardocotta.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}