{"id":70,"date":"2008-10-28T22:53:11","date_gmt":"2008-10-29T05:53:11","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=5"},"modified":"2008-10-28T22:53:11","modified_gmt":"2008-10-29T05:53:11","slug":"function-returns-a-function","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=70","title":{"rendered":"Function Returns a Function"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\n\r\nappendExclamation(&quot;actionsnippit&quot;)(&quot;dot&quot;)(&quot;com&quot;)(&quot;is&quot;)(&quot;live&quot;);\r\n\r\nfunction appendExclamation(str:String):Function{\r\n  trace(str + &quot;! &quot;);\r\n  return appendExclamation;\r\n}\r\n\r\n\/* outputs:\r\nactionsnippit!\r\ndot!\r\ncom!\r\nis!\r\nlive!\r\n*\/\r\n\r\n<\/pre>\n<p>This technique allows you to call a function more than once on one line. I first saw this used in the source files from a talk at flashcoders ny&#8230; I didn&#8217;t attend the talk, but stumbled on this interesting blog post awhile back <a href=\"http:\/\/www.flashcodersny.org\/wordpress\/?p=166\">http:\/\/www.flashcodersny.org\/wordpress\/?p=166<\/a>. <\/p>\n<p>This is a fun technique to use, I&#8217;ve found some unusual uses for it already&#8230; some of which you&#8217;ll see in later posts&#8230;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>appendExclamation(&quot;actionsnippit&quot;)(&quot;dot&quot;)(&quot;com&quot;)(&quot;is&quot;)(&quot;live&quot;); function appendExclamation(str:String):Function{ trace(str + &quot;! &quot;); return appendExclamation; } \/* outputs: actionsnippit! dot! com! is! live! *\/ This technique allows you to call a function more than once on one line. I first saw this used in the source files from a talk at flashcoders ny&#8230; I didn&#8217;t attend the talk, but stumbled on [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,18],"tags":[],"class_list":["post-70","post","type-post","status-publish","format-standard","hentry","category-functions","category-return-values"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/70","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=70"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/70\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=70"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=70"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=70"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}