The question of javascript Function.prototype.bind method has been read for a long time. I can't understand it. If you have a friend who knows it, give me an answer.

var bind = function (bind) {
    return {
        bind: bind.bind(bind),
        call: bind.bind(bind.call),
        apply: bind.bind(bind.apply)
    }
}(Function.prototype.bind);

var concat = bind.apply([].concat);
var a = [1, [2, 3], 4];
var b = [1, 3];
console.log(concat(b, a)); //[ 1, 3, 1, 2, 3, 4 ]```
Oct.22,2021

from the title:

bind.apply = = Function.prototype.bind.bind (Function.prototype.bind.apply)
= = Function.prototype.bind.apply.bind

concat = = Function.prototype.bind.apply.bind ([] .concat) = = [] .concat.apply

concat (b, a) = = [] .concat.apply (b, a) = = b.concat (.a)

Menu