{"id":125,"date":"2009-02-17T12:38:31","date_gmt":"2009-02-17T17:38:31","guid":{"rendered":"http:\/\/hoolihan.net\/blog-tim\/?p=125"},"modified":"2009-06-29T12:08:19","modified_gmt":"2009-06-29T17:08:19","slug":"arrays-as-objects-in-javascript","status":"publish","type":"post","link":"http:\/\/hoolihan.net\/blog-tim\/2009\/02\/17\/arrays-as-objects-in-javascript\/","title":{"rendered":"Arrays as Objects in Javascript"},"content":{"rendered":"<p>Rhino Prompt&#8230;<\/p>\n<pre>\r\njs> a[0] = 1;\r\njs> a.print = function () {for(var e in this) print (\"a[\" + e + \"] = \" + a[e]);};\r\n\r\nfunction () {\r\n    for (var e in this) {\r\n        print(\"a[\" + e + \"] = \" + a[e]);\r\n    }\r\n}\r\n\r\njs> a.print();\r\na[0] = 1\r\na[print] = \r\nfunction () {\r\n    for (var e in this) {\r\n        print(\"a[\" + e + \"] = \" + a[e]);\r\n    }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Rhino Prompt&#8230; js> a[0] = 1; js> a.print = function () {for(var e in this) print (&#8220;a[&#8221; + e + &#8220;] = &#8221; + a[e]);}; function () { for (var e in this) { print(&#8220;a[&#8221; + e + &#8220;] = &#8221; + a[e]); } } js> a.print(); a[0] = 1 a[print] = function () { [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[54,18],"tags":[61,69,60],"class_list":["post-125","post","type-post","status-publish","format-standard","hentry","category-javascript","category-programming","tag-arrays","tag-linkedin","tag-objects"],"_links":{"self":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/posts\/125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/comments?post=125"}],"version-history":[{"count":0,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/posts\/125\/revisions"}],"wp:attachment":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/media?parent=125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/categories?post=125"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/tags?post=125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}