What is the problem that this will fail when bind is called as new?

read what a big guy wrote:

Function.prototype.bind = Function.prototype.bind || function (context) {
    var me = this;
    var args = Array.prototype.slice.call(arguments, 1);
    var F = function () {};
    F.prototype = this.prototype;
    var bound = function () {
        var innerArgs = Array.prototype.slice.call(arguments);
        var finalArgs = args.concat(innerArgs);
        return me.apply(this instanceof F ? this : context || this, finalArgs);
    }
    bound.prototype = new F();
    return bound;
}

how is this compatible? boss, try to be more detailed. And the specific scenario of bind this failure?

Feb.26,2021

  1. the first parameter of bind is the context, that is, the this points to, and the rest are the parameters to be passed to the function to be bound later, either partially or entirely
  2. declares a function that needs to be returned; you need to reset its prototype chain to point to the prototype chain of the original function; this function is the bound function, which needs to combine the passed parameters with the previous parameters, and then call
  3. in the context of the binding.
  4. I don't know what you mean by this failure
Menu