r/ProgrammerHumor • • Jun 21 '18

Thanks Brendan for giving us the Javascript

Post image
3.1k Upvotes

302 comments sorted by

View all comments

Show parent comment

2

u/junrrein Jun 27 '18

The thing is, I can foresee that using dynamic this makes stuff confusing and difficult to follow, so why use it at all? I'm not talking about the syntax differences between "classic" anonymous functions and arrow functions, but about the differences in scoping for this.

1

u/Code_star Jun 27 '18

I am talking about this I use the dynamic this often. It really just depends man. What is cool I think is you don't have to have one or the other, or right any strange closures like var This = this to use the one you want anymore

1

u/junrrein Jun 27 '18

I guess that in the context of Javascript, having dynamic this makes sense. It would be completely fucked in other languages that have OOP, where instance variables have public/private access modifiers.