O'Reilly logo
  • Nate Wittnam thinks this is interesting:

You’ll notice that the self-reference this returned from the embedded fun function returns the object a itself. This is probably what you would expect. However, observe the following:

var bObj = {name: "b", fun: function(){ return this }};



Cover of Functional JavaScript


perils of this