You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your blog is awesome!!!!
But I was confused with this.
In the function decorate ,you wrote this
'return oldFunc.apply(that, Array.prototype.slice.call(arguments));'.
Why you 'apply(null.....', this will make functions of the object lose ' this ' in their context. Why didn't you give obj to them.
The text was updated successfully, but these errors were encountered:
Hello, sorry about the late reply, for some reason Github did not give me an email about this. Anyways, I am assuming you are referring to the 2014 decorate.js post. I think I just forgot to add context passing at that time as it was not essential for the example. This is also combined with my style of coding which generally avoids using 'this'. I find it much clearer and less error prone when a context is explicitly passed in to a function as an argument or comes from a context created directly in the main part of an object.
Though for this example passing in obj would probably be clearer, so I have added that. Thanks for pointing that out.
Your blog is awesome!!!!
But I was confused with this.
In the function decorate ,you wrote this
'return oldFunc.apply(that, Array.prototype.slice.call(arguments));'.
Why you 'apply(null.....', this will make functions of the object lose ' this ' in their context. Why didn't you give obj to them.
The text was updated successfully, but these errors were encountered: