{"id":116,"date":"2008-12-07T00:00:25","date_gmt":"2008-12-07T07:00:25","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=304"},"modified":"2008-12-07T00:00:25","modified_gmt":"2008-12-07T07:00:25","slug":"objectprototype-hack","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=116","title":{"rendered":"Object.prototype Crap"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nObject.prototype.myVar = &quot;I am a variable&quot;;\r\n\r\nvar s:Sprite = new Sprite();\r\n \r\ntrace(Object(s).myVar);\r\n\r\nvar v:Video = new Video();\r\ntrace(Object(v).myVar);\r\n<\/pre>\n<p>This&#8230;. should not be done&#8230; and setting myVar like this:<\/p>\n<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nObject(s).myVar = &quot;hello&quot;;\r\n<\/pre>\n<p>Will cause an error&#8230;.<\/p>\n<p>I keep a folder on my laptop for this website&#8230;.. when I have a random snippet idea I put it in this folder&#8230;. Every couple of weeks I go through this folder and turn select snippets into posts&#8230;. when I rediscovered this snippet today it really made me laugh&#8230;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Object.prototype.myVar = &quot;I am a variable&quot;; var s:Sprite = new Sprite(); trace(Object(s).myVar); var v:Video = new Video(); trace(Object(v).myVar); This&#8230;. should not be done&#8230; and setting myVar like this: Object(s).myVar = &quot;hello&quot;; Will cause an error&#8230;. I keep a folder on my laptop for this website&#8230;.. when I have a random snippet idea I put it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,7],"tags":[3,4,64],"class_list":["post-116","post","type-post","status-publish","format-standard","hentry","category-dynamic","category-object","tag-actionscript","tag-flash","tag-prototype"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/116","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=116"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/116\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}