jeudi 29 janvier 2015

What does the `shiftBind` function here mean?


In a javascript snippet, I saw codes like this..



nglr.shiftBind = function(_this, _function) {
return function() {
var args = [ this ];
for ( var i = 0; i < arguments.length; i++) {
args.push(arguments[i]);
}
return _function.apply(_this, args);
};
};


This looks a little abstract for me to understand... Could anyone have an example about what this really does..


Thanks!





Aucun commentaire:

Enregistrer un commentaire