{"push_id":839692245,"size":1,"distinct_size":1,"ref":"refs/heads/Chp_18EnsuringCorrectUseOfCallApplyBinding","head":"9b1bc07d22db72e91642f3f524cb8a18c332c476","before":"ad730e3341e4cdc3d7b89858710b69d3426d9c3d","commits":[{"sha":"9b1bc07d22db72e91642f3f524cb8a18c332c476","author":{"email":"688085edcac35a6f5d4cd9ba4db0e893cb0d2736@gmail.com","name":"petrero"},"message":"  To really see that it’s the call site rather than the declaration of a function that determines how this is bound, consider this last code\n  In the last code, the function valIncrementor , which contains the this.val++ statement, is defined globally; its declaration is not contained within an object. When obj is defined, its incrementValue property is assigned to the valIncrementor function.\n  The globally defined valIncrementor function is then executed three times via incrementValue , the reference to it that’s contained within the obj object. Even though valIncrementor is defined globally, it’s called with obj as its context at the three call sites. Thus, this is bound to obj , and obj.val is incremented by the function.","distinct":true,"url":"https://api.github.com/repos/pyterDiaconescu/ReliableJavascript/commits/9b1bc07d22db72e91642f3f524cb8a18c332c476"}]}