{"id":318,"date":"2012-01-17T22:32:25","date_gmt":"2012-01-18T03:32:25","guid":{"rendered":"http:\/\/littlesvr.ca\/grumble\/?p=318"},"modified":"2012-12-05T00:49:14","modified_gmt":"2012-12-05T05:49:14","slug":"scoping-in-javascript","status":"publish","type":"post","link":"http:\/\/littlesvr.ca\/grumble\/2012\/01\/17\/scoping-in-javascript\/","title":{"rendered":"Scoping in JavaScript"},"content":{"rendered":"<blockquote><p>There are a number of articles and blog posts out there trying to explain scope and closures, but overall I\u2019d say that a majority of them aren\u2019t crystal-clear.<\/p><\/blockquote>\n<p>No sh**. I&#8217;ve been trying to figure out how scope works in JavaScript on-and-off for the last several years. I was never a committed JS programmer though so it wasn&#8217;t important enough for me to make sure I learn it once and for all.<\/p>\n<p>Why is it that something as simple as scope is so complicated? That was a rhetorical question, I don&#8217;t really want to hear excuses. Last week I was working on some moderately advanced JS code and sure enough I spent hours finding impossible bugs caused by assignments that overwrote values in the wrong variables.<\/p>\n<p>I have no choice but to suck it up, but this blog is a partial registry of my complaints, and this one was definitely worth mentioning.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are a number of articles and blog posts out there trying to explain scope and closures, but overall I\u2019d say that a majority of them aren\u2019t crystal-clear. No sh**. I&#8217;ve been trying to figure out how scope works in JavaScript on-and-off for the last several years. I was never a committed JS programmer though &hellip; <\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[],"class_list":{"0":"entry","1":"post","2":"publish","3":"author-andrew","4":"post-318","6":"format-standard","7":"category-ostd","8":"category-safeforseneca"},"_links":{"self":[{"href":"http:\/\/littlesvr.ca\/grumble\/wp-json\/wp\/v2\/posts\/318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/littlesvr.ca\/grumble\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/littlesvr.ca\/grumble\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/littlesvr.ca\/grumble\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/littlesvr.ca\/grumble\/wp-json\/wp\/v2\/comments?post=318"}],"version-history":[{"count":3,"href":"http:\/\/littlesvr.ca\/grumble\/wp-json\/wp\/v2\/posts\/318\/revisions"}],"predecessor-version":[{"id":588,"href":"http:\/\/littlesvr.ca\/grumble\/wp-json\/wp\/v2\/posts\/318\/revisions\/588"}],"wp:attachment":[{"href":"http:\/\/littlesvr.ca\/grumble\/wp-json\/wp\/v2\/media?parent=318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/littlesvr.ca\/grumble\/wp-json\/wp\/v2\/categories?post=318"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/littlesvr.ca\/grumble\/wp-json\/wp\/v2\/tags?post=318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}