{"id":962,"date":"2024-12-15T06:34:55","date_gmt":"2024-12-15T06:34:55","guid":{"rendered":"https:\/\/monkey.ploogie.co.uk\/?page_id=962"},"modified":"2024-12-15T06:34:55","modified_gmt":"2024-12-15T06:34:55","slug":"mwnci-map-function","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-map-function\/","title":{"rendered":"Mwnci map() Function"},"content":{"rendered":"<h2>Syntax<\/h2>\n<p>map<strong>(<em>string|array, <\/em><em>string<\/em>)<\/strong><\/p>\n<h2>Description<\/h2>\n<p>The <i>map()<\/i> function executes a specified function for each item in a string or array. The item is sent to the function as a parameter.<\/p>\n<h2>Example<\/h2>\n<pre>\r\nfunction  myfunc(n) {\r\n    return len(n)\r\n}\r\nx=map([\"bus\", \"lorry\", \"boat\"], myfunc)\r\nprintln(x)\r\n\r\n\r\n[3, 5, 4]\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Syntax map(string|array, string) Description The map() function executes a specified function for each item in a string or array. The item is sent to the function as a parameter. Example function myfunc(n) { return len(n) } x=map([&#8220;bus&#8221;, &#8220;lorry&#8221;, &#8220;boat&#8221;], myfunc) println(x) [3, 5, 4]<\/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-962","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/962","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=962"}],"version-history":[{"count":2,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/962\/revisions"}],"predecessor-version":[{"id":964,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/962\/revisions\/964"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=962"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}