Why do you need this instance bound to implement bind with ES5

Function.prototype.bind =  function(that){
        var self = this,
            args = arguments.length > 1 ? Array.slice(arguments, 1) : null,
            F = function(){};

        var bound = function(){
            var context = that, length = arguments.length;
            if (this instanceof bound){
                F.prototype = self.prototype;
                context = new F;
            }
            var result = (!args && !length)
                ? self.call(context)
                : self.apply(context, args && length ? args.concat(Array.slice(arguments)) : args || arguments);
            return context == that ? result : context;
        };
        return bound;
    },

generally use the above method to implement the bind function through ES5 . I don"t quite understand why it is necessary to make such a judgment in the bound function,
if (this instanceof bound) .

Mar.05,2021

new (Fn.bind(null));
This judgment is entered when

generates an instance of a bound method.

Menu