Created
February 18, 2014 18:08
-
-
Save shyamsalimkumar/9076359 to your computer and use it in GitHub Desktop.
Helper method to set the value of 'this'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Helper method to set the value of 'this'. | |
* @param {Object} thisObject The value of 'this' to be set. | |
* @return {Function} Function whose this is to be set with custom this set. | |
*/ | |
Function.prototype.bind = function ( thisObject ) { | |
var that = this; | |
return function () { that.apply( thisObject, arguments ); }; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment