Skip to content Skip to sidebar Skip to footer
Showing posts with the label Closures

Javascript - Referencing 'this' In An Inner Function

Consider the following code: MyClass.prototype.my_func = function () { this.x = 10; $.ajax(… Read more Javascript - Referencing 'this' In An Inner Function

Why Use Closure In That Simple Case?

In this article http://howtonode.org/why-use-closure an example is given : function greeter(name, a… Read more Why Use Closure In That Simple Case?

Binding "this" When Passing An Object's Member Function

I had a 'class' defined and was making only one instance of it. The instance possessed a me… Read more Binding "this" When Passing An Object's Member Function

Effective Javascript Book Having Trouble Understanding Item 13(iffy)

Trying to read this wonderful book of effective javascript(but I am still novice).. In item 13, it … Read more Effective Javascript Book Having Trouble Understanding Item 13(iffy)

What Are The Closures For Exactly?

I have been reading about closures and javascript, and I thought I got it, till I tried this: var O… Read more What Are The Closures For Exactly?

Javascript Closure Tutorial From Eloquent Javascript

the question is pretty similar to this thread Javascript..totally lost in this tutorial. functi… Read more Javascript Closure Tutorial From Eloquent Javascript

How Does The Js Scope Of These Blocks Work?

Can anyone explain why the following produces 1,2 and the other produces 5? Should they not both pr… Read more How Does The Js Scope Of These Blocks Work?

Javascript Closure After Using Anonymous Function

I'm working on closure so hard, and I know that in the loop, new function refer closure using … Read more Javascript Closure After Using Anonymous Function