{"id":455,"date":"2010-01-02T05:12:12","date_gmt":"2010-01-02T12:12:12","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=2547"},"modified":"2010-01-02T05:12:12","modified_gmt":"2010-01-02T12:12:12","slug":"array-map","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=455","title":{"rendered":"Array map"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nvar a:Array = &#x5B;1,2,3,4,5,6];\r\nvar double:Array = a.map(function():int{return arguments&#x5B;0] * 2});\r\ntrace(double);\r\n\/*outputs:\r\n2,4,6,8,10,12\r\n*\/\r\n<\/pre>\n<p>A condensed example of Array.map() <\/p>\n<p>Here is the same thing written in <a href=\"http:\/\/www.haskell.org\/\">haskell<\/a>:<\/p>\n<pre>\r\na = [1,2,3,4,5,6]\r\ndouble = map (*2) a\r\n\r\nmain = print double\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>var a:Array = &#x5B;1,2,3,4,5,6]; var double:Array = a.map(function():int{return arguments&#x5B;0] * 2}); trace(double); \/*outputs: 2,4,6,8,10,12 *\/ A condensed example of Array.map() Here is the same thing written in haskell: a = [1,2,3,4,5,6] double = map (*2) a main = print double<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,17],"tags":[3,14,4],"class_list":["post-455","post","type-post","status-publish","format-standard","hentry","category-arrays","category-functions","tag-actionscript","tag-as3","tag-flash"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/455","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=455"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/455\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}