Friday, December 19, 2014

bind() method in JavaScript

bind() method - Hard binding

bind() method creates a new function that will have "this" set to the parameter passed to bind.
bind() method is used when we want "this" value to be predictable

In the above program displayName() method always has obj1 as "this" value.


Link 1 - Hard binding
Link 2 - Hard binding
Link 3 - Hard binding
Link 4 - Hard binding

No comments:

Post a Comment