{"id":1341,"date":"2022-08-30T15:15:43","date_gmt":"2022-08-30T15:15:43","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/10\/how-do-you-remove-a-method-from-a-javascript-type-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:15:43","modified_gmt":"2022-08-30T15:15:43","slug":"how-do-you-remove-a-method-from-a-javascript-type-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/how-do-you-remove-a-method-from-a-javascript-type-collection-of-common-programming-errors\/","title":{"rendered":"How do you remove a method from a javascript type-Collection of common programming errors"},"content":{"rendered":"<p>I have a bit of javascript that runs on a 3rd party&#8217;s website which requires me to temporarily add a function to the Array type, e.g.<\/p>\n<pre><code>Array.prototype.foo = function() { alert(\"foo's for everyone!\"); }; \n<\/code><\/pre>\n<p>I want to be a good developer and not pollute the type systems of other people&#8217;s code as much as possible so once the function is no longer needed I want to remove the function again. Is this possible?<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-10 00:45:35. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I have a bit of javascript that runs on a 3rd party&#8217;s website which requires me to temporarily add a function to the Array type, e.g. Array.prototype.foo = function() { alert(&#8220;foo&#8217;s for everyone!&#8221;); }; I want to be a good developer and not pollute the type systems of other people&#8217;s code as much as possible [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1341","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1341","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1341"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1341\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1341"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1341"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}