{"id":689,"date":"2024-11-19T09:38:18","date_gmt":"2024-11-19T09:38:18","guid":{"rendered":"http:\/\/monkey.ploogie.co.uk\/?page_id=689"},"modified":"2024-11-21T11:11:05","modified_gmt":"2024-11-21T11:11:05","slug":"mwnci-enumerate-function","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-enumerate-function\/","title":{"rendered":"Mwnci enumerate() Function"},"content":{"rendered":"<h2>Syntax<\/h2>\n<p>enumerate<strong>(<em>array<\/em>, <em>[integer]<\/em>)<\/strong><\/p>\n<h2>Description<\/h2>\n<p>The <i>enumerate()<\/i> function returns the contents of an array as a collection of array pairs, and adds a counter as the key of the enumerate array.<\/p>\n<p>If no count start value is given, then 0 is used<\/p>\n<h2>Example<\/h2>\n<pre>include(\"main\")\r\na=[\"Red\", \"Yellow\", \"Blue\"]\r\nprintln(enumerate(a))\r\nprintln(enumerate(a, 100))\r\n\r\n\r\n[[0, \"Red\"], [1, \"Yellow\"], [2, \"Blue\"]]\r\n[[100, \"Red\"], [101, \"Yellow\"], [102, \"Blue\"]]\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Syntax enumerate(array, [integer]) Description The enumerate() function returns the contents of an array as a collection of array pairs, and adds a counter as the key of the enumerate array. If no count start value is given, then 0 is used Example include(&#8220;main&#8221;) a=[&#8220;Red&#8221;, &#8220;Yellow&#8221;, &#8220;Blue&#8221;] println(enumerate(a)) println(enumerate(a, 100)) [[0, &#8220;Red&#8221;], [1, &#8220;Yellow&#8221;], [2, &#8220;Blue&#8221;]] &hellip; <a href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-enumerate-function\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Mwnci enumerate() Function&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-689","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/689","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=689"}],"version-history":[{"count":4,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/689\/revisions"}],"predecessor-version":[{"id":725,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/689\/revisions\/725"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=689"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}