Skip to content

Instantly share code, notes, and snippets.

@Bambina-zz
Created July 29, 2015 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bambina-zz/449a780fc035d727f7e5 to your computer and use it in GitHub Desktop.
Save Bambina-zz/449a780fc035d727f7e5 to your computer and use it in GitHub Desktop.
js bind method
var sum = function(x,y,z){
return x+y+z;
};
//bind()の第一引数は新たに作られる関数thisの値。今回はnull.
var newFunc = sum.bind(null,2,3);
console.log(newFunc(1)); //=>6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment