{"id":205,"date":"2014-11-06T09:12:52","date_gmt":"2014-11-06T09:12:52","guid":{"rendered":"http:\/\/www.javascripttutorials.net\/?p=205"},"modified":"2020-05-04T23:20:53","modified_gmt":"2020-05-04T21:20:53","slug":"scope-chains-and-closures-in-javascript","status":"publish","type":"post","link":"https:\/\/www.javascripttutorials.net\/scope-chains-and-closures-in-javascript\/","title":{"rendered":"Scope Chains and Closures in JavaScript"},"content":{"rendered":"<p>The goal of this talk is for you to understand scopes, scope chains, and closures. You will also be able to easily and quickly explain them to other developers.<!--more--><\/p>\n<p>There is a trend in developers resorting to a kind of hand-waving in their descriptions of these terms, \u201cIf you\u2019ve ever had the situation where someone asked you about how scope chains or closures work, and you started the explanation, but then all of a sudden you were like \u2018well&#8230; it is kind of like when you do this.\u2019 So, anytime you&#8217;re saying it&#8217;s &#8216;kind of like when,&#8217; that&#8217;s usually a warning that maybe something&#8217;s not quite working.\u201d<\/p>\n<p><iframe loading=\"lazy\" title=\"JavaScript Scope Chains and Closures\" width=\"730\" height=\"411\" src=\"https:\/\/www.youtube.com\/embed\/zRZNb4GDOPI?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>Video producer: <a href=\"https:\/\/thenewcircle.com\/\">https:\/\/thenewcircle.com\/<\/a><\/p>\n<p>Event producer: <a href=\"http:\/\/www.meetup.com\/jsmeetup\/events\/177364632\/\">San Francisco JavaScript Meetup<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The goal of this talk is for you to understand scopes, scope chains, and closures. You will also be able to easily and quickly explain them to other developers.<\/p>\n","protected":false},"author":1,"featured_media":251,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[35],"class_list":["post-205","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","tag-closures"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.javascripttutorials.net\/wp-json\/wp\/v2\/posts\/205","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javascripttutorials.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javascripttutorials.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javascripttutorials.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javascripttutorials.net\/wp-json\/wp\/v2\/comments?post=205"}],"version-history":[{"count":0,"href":"https:\/\/www.javascripttutorials.net\/wp-json\/wp\/v2\/posts\/205\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javascripttutorials.net\/wp-json\/wp\/v2\/media\/251"}],"wp:attachment":[{"href":"https:\/\/www.javascripttutorials.net\/wp-json\/wp\/v2\/media?parent=205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javascripttutorials.net\/wp-json\/wp\/v2\/categories?post=205"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javascripttutorials.net\/wp-json\/wp\/v2\/tags?post=205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}