DEV Community

Discussion on: JavaScript 'this' illustrated: Learn it once and for all!

Collapse
anubarak profile image
Robin Schambach

Thanks for sharing this however I think you really miss a lot of use cases. Your sketch does not cover 95% of use cases. Not even 30%.
Things you might consider to add

  • difference between ES5 functions and arrow functions
  • js bind function (even tho you mentioned call)
  • this in event listeners -> this can be the element in the Dom (you could consider the 2nd example but I think that's not really clear)
  • difference between this in ES5 like classes and ES6 classes
  • special use cases in nested closure calls (the reason why many use a self variable, I know you could combine the already known logic but in a guide you should address and combine multiple rules)