Sometimes the bind() method has to be used to prevent losing this, especially in callback. but actually, in ES6 we use the arrow function instead of bind hack to avoid such unwanted mistakes!✌
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
ah, got it
really hadn't thought about callbacks, but that makes some sense
Sometimes the
bind()
method has to be used to prevent losingthis
, especially in callback. but actually, in ES6 we use the arrow function instead of bind hack to avoid such unwanted mistakes!✌