Created
          November 8, 2011 22:17 
        
      - 
      
- 
        Save dsc/1349461 to your computer and use it in GitHub Desktop. 
    Function.prototype.bind
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | // See https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/bind | |
| // for a more verbose-but-standards-compliant version. | |
| if (!Function.prototype.bind) { | |
| Function.prototype.bind = function(context){ | |
| var fn = this, args = [].slice.call(arguments, 1); | |
| return function(){ | |
| return fn.apply( context, args.concat([].call(arguments)) ); | |
| }; | |
| }; | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment