For the last three weeks, I’ve had the honor of contributing a quick tip to the Web Tools Weekly newsletter. This is a newsletter that covers all things web development, typically from a tooling perspective. I’ve been a subscriber to this weekly newsletter for a while now, and I really like it – you should check it out, too. It’s worth a minute of time each week, to get some good tips on tools to look into, and for the development tip at the beginning of each issue.
My 3 Tips: .call, .apply And .bind Your Functions
Check out each of these three issues for more information on using these function modifiers.
- Issue 42: Using .call and .apply to manage “this”
- Issue 43: Using .bind to manage “this”
- Issue 44: Partial function application with .bind
Learn The Complete Rules For Managing “this”
Using .call, .apply and .bind will help you manage “this” in your function calls – but these aren’t the only ways to do this. There are a total of 5 rules and techniques that you need to understand, to manage “this” correctly – including how you invoke a function (yes, changing how you invoke a function will change “this” in that function!)
P.S. Be sure to read the short intro to the newsletter issues if you’re interested in WatchMeCode. :)