{"id":782,"date":"2024-11-28T14:02:52","date_gmt":"2024-11-28T14:02:52","guid":{"rendered":"http:\/\/monkey.ploogie.co.uk\/?page_id=782"},"modified":"2024-11-28T14:03:03","modified_gmt":"2024-11-28T14:03:03","slug":"mwnci-swap-function","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-swap-function\/","title":{"rendered":"Mwnci swap() Function"},"content":{"rendered":"<h2>Syntax<\/h2>\n<p>swap<strong>(<em>array<\/em>,<em>integer<\/em>,<em>integer<\/em>,)<\/strong><\/p>\n<h2>Description<\/h2>\n<p>The <i>swap()<\/i> function returns a new array, with the values of the given indexes swapped. If an index is not withing the length of the array, an error is returned.<\/p>\n<h2>Example<\/h2>\n<pre>\r\na=[1,2,3,4,5]\r\nb=swap(a, 0, 3)\r\nprintln(b)\r\n\r\n\r\n[4, 2, 3, 1, 5]\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Syntax swap(array,integer,integer,) Description The swap() function returns a new array, with the values of the given indexes swapped. If an index is not withing the length of the array, an error is returned. Example a=[1,2,3,4,5] b=swap(a, 0, 3) println(b) [4, 2, 3, 1, 5]<\/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-782","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/782","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=782"}],"version-history":[{"count":2,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/782\/revisions"}],"predecessor-version":[{"id":784,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/782\/revisions\/784"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=782"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}