Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Expand `javascript-101/scope` #89

ajpiano opened this Issue · 8 comments

6 participants


Expand to expain call and apply, and explain them in the context that beginners are familiar with - the notion of this "changing" as you go from one section of code into an event handler . We should link to, if not borrow from, @wycats's Understanding JavaScript Function Invocation and “this”.

We should also explain how to use $.proxy and/or Function.prototype.bind to control the scope of a function later on, as well as the good old var that = this pattern.


I've reached out to Yehuda to see if he would be okay with us borrowing some of his content for this. Failing this, I know WebReflection and one or two others have also covered this topic before.

When you say we should cover $.proxy, do you mean in another section or in JS101? I mentioned this in another issue but perhaps it would make sense to avoid jQuery examples here and cover those in follow up sections?.


@addyosmani I think we should avoid jQuery examples in JS101, thus moving $.proxy to a different section. I think it makes sense to keep JS101 and jQuery separate.


Scope and this in JavaScript by @jackfranklin has a lot of the nuts-and-bolts "how to deal with scope" content that I'd been envisioning for this article. Let's use it as a reference point or see if @jackfranklin is willing to contribute some of the content back here :)


Hey @ajpiano thanks for the mention :) I'd be happy to contribute content from that article into the site. How best do you want to go about it?


@jackfranklin: Does your gracious offer still stand?


@adrocknaphobia wow, forgot about this! Yes it does :)


@jackfranklin Awesome, sorry about the..... lull :)

The best thing to do is just fork this repo and work your content into the existing scope article and file a pull request. I think this article is going to be a somewhat low-level, "Scope: What is This," and then we should have a separate article on scope manipulation, how you can do it, and how it happens a lot under the hood in jQuery.


This was addressed a year ago in 6fc9783.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.