If you want to adopt a functional style, then there is little benefit to using `this` instead of regular arguments or closures, which are more versatile and follow more straightforward rules. I think most JS developers have been confused over the value of `this` more than once.
back
1 comments
I would think call and apply would be useful for a functional style, but no?
YMMV, but I thought I would use them more regularly the more I wrote my JS in a functional style, but the use cases started to steadily dry up; it's gets much easier to write code that simply doesn't need to hold the reference in that way. Arrow functions help a great deal (there is no concept of `this` within them). Still very useful, but in very specific cases, or abstracted off into helpers. I've found `bind()` is much more useful (and will become moreso if the bind operator is okayed and optimised).
For sure, but probably more as a way to handle arguments than to set the context. Or to work in a more FP-ish way with an OO-ish API.