Expand `javascript-101/scope` #89

Closed
ajpiano opened this Issue Mar 16, 2012 · 8 comments

Comments

Projects
None yet
6 participants
@ajpiano
Member

ajpiano commented Mar 16, 2012

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.

@addyosmani

This comment has been minimized.

Show comment Hide comment
@addyosmani

addyosmani Mar 25, 2012

Member

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?.

Member

addyosmani commented Mar 25, 2012

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?.

@connor

This comment has been minimized.

Show comment Hide comment
@connor

connor Mar 28, 2012

Contributor

@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.

Contributor

connor commented Mar 28, 2012

@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.

@ajpiano

This comment has been minimized.

Show comment Hide comment
@ajpiano

ajpiano Apr 20, 2012

Member

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 :)

Member

ajpiano commented Apr 20, 2012

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 :)

@jackfranklin

This comment has been minimized.

Show comment Hide comment
@jackfranklin

jackfranklin Apr 21, 2012

Contributor

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?

Contributor

jackfranklin commented Apr 21, 2012

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?

@adrocknaphobia

This comment has been minimized.

Show comment Hide comment
@adrocknaphobia

adrocknaphobia Oct 15, 2012

@jackfranklin: Does your gracious offer still stand?

@jackfranklin: Does your gracious offer still stand?

@jackfranklin

This comment has been minimized.

Show comment Hide comment
@jackfranklin

jackfranklin Oct 15, 2012

Contributor

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

Contributor

jackfranklin commented Oct 15, 2012

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

@ajpiano

This comment has been minimized.

Show comment Hide comment
@ajpiano

ajpiano Nov 2, 2012

Member

@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.

Member

ajpiano commented Nov 2, 2012

@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.

@scottgonzalez

This comment has been minimized.

Show comment Hide comment
@scottgonzalez

scottgonzalez Apr 7, 2014

Member

This was addressed a year ago in 6fc9783.

Member

scottgonzalez commented Apr 7, 2014

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