Function.prototype.myBind = function( context ) {
var f,
bound_args = Array.prototype.slice.call(arguments, 1),
bound_function = function() {
return f.apply(context, bound_args.concat(Array.prototype.slice.call(arguments)));
};
if (typeof this._original_ === 'function') {
f = this._original_;
} else {
f = this;
bound_function._original_ = f;
}
return bound_function;
}
s = console.log.bind(null, 1, 2);
s( 3 );
// 1, 2, 3
s = console.log.myBind(null, 1, 2);
s( 3 );
// 1, 2
s( 3, 4, 5 );
// 1, 2
Вот например список его последних вопросов: