DEV Community

Discussion on: Creating your own bind() (Polyfill of bind)

Collapse
 
adam_cyclones profile image
Adam Crockett πŸŒ€

I haven't used bind very often since arrow functions

Collapse
 
uddeshjain profile image
Uddesh

Arrow function are really helpful for adopting β€˜this’ from their parent and in most of the use cases we don’t need β€˜bind()’, But what if you want β€˜this’ to refer to a particular object then you need to use β€˜bind()’. I hope you got my point.

Collapse
 
adam_cyclones profile image
Adam Crockett πŸŒ€

To be honest, I only use bind for it's less well known second Param. I avoid using this and prefer pure functions, I have very few reasons to make this do anything, bimut that's just me ☺️