Function.prototype.bind [correction]

# David-Sarah Hopwood (17 years ago)

David-Sarah Hopwood wrote:

So, is this a valid self-hosting specification of bind?

(function() { use lexical scope;

Function.prototype.bind = function(self, var_args) {
  const thisFunc = this;
  const leftArgs = Array.slice(arguments, 1);
  return function(var_args) {
    const args = leftArgs.concat(Array.slice(arguments, 0));
    return Function.apply(thisFunc, self, args);
  };
};

)();

... if the missing } on the last line is corrected.