{"id":2660,"date":"2021-06-17T13:31:28","date_gmt":"2021-06-17T16:31:28","guid":{"rendered":"http:\/\/outsmart.com.br?p=2660"},"modified":"2021-06-23T11:49:09","modified_gmt":"2021-06-23T14:49:09","slug":"manipulando-o-for-each","status":"publish","type":"post","link":"https:\/\/outsmart.com.br\/manipulando-o-for-each\/","title":{"rendered":"Manipulando o for each"},"content":{"rendered":"\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n

Elem\u200bent<\/strong>
A tarefa for each element intera por meio de todos elementos presentes em uma lista.
No exemplo abaixo criamos uma lista de cores, e para cada elemento na lista de cores, vamos imprimi-lo.<\/p>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t

\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t \t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t

Index<\/strong>
A tarefa for each index intera atrav\u00e9s do \u00edndice de todos os elementos presentes em uma lista.
Abaixo declaramos uma lista de cores na mesma fizemos a seguintes especifica\u00e7\u00e3o, para cada \u00edndice de coresIndex em listaCores vamos imprimir coresIndex entre par\u00eanteses concatenado com listaCores.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t

\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t \t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"

Elem\u200bentA tarefa for each element intera por meio de todos elementos presentes em uma lista.No exemplo abaixo criamos uma lista de cores, e para cada elemento na lista de cores, vamos imprimi-lo. Cores = {“Azul”,”Rosa”,”Branco”,”Vemelho”,”Preto”,”Roxo”}; \/\/ Criamos uma lista for each lista in Cores \/\/ Interar para cada elemento da lista usando o for each […]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-2660","post","type-post","status-publish","format-standard","hentry","category-zoho-deluge","entry"],"_links":{"self":[{"href":"https:\/\/outsmart.com.br\/wp-json\/wp\/v2\/posts\/2660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/outsmart.com.br\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/outsmart.com.br\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/outsmart.com.br\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/outsmart.com.br\/wp-json\/wp\/v2\/comments?post=2660"}],"version-history":[{"count":4,"href":"https:\/\/outsmart.com.br\/wp-json\/wp\/v2\/posts\/2660\/revisions"}],"predecessor-version":[{"id":2822,"href":"https:\/\/outsmart.com.br\/wp-json\/wp\/v2\/posts\/2660\/revisions\/2822"}],"wp:attachment":[{"href":"https:\/\/outsmart.com.br\/wp-json\/wp\/v2\/media?parent=2660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/outsmart.com.br\/wp-json\/wp\/v2\/categories?post=2660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/outsmart.com.br\/wp-json\/wp\/v2\/tags?post=2660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}