About using call bind class arrays to convert arrays and using them to determine whether there are corresponding attribute values in the object?

clipboard.png
is shown in the figure.
call bind is not quite understood when used together. Why do you write like that?
I would also like to ask all the bosses to explain. Thank you very much


it doesn't make any sense to write this, it just increases the complexity of the code.

the reason looks directly at the code:

Function.call.bind === Function.bind // true

-Update-

Function.bind (xxx) will make a mistake because it is dying to listen.

the specific reason should be

The native code function generated by

Function.bind. If the argument is of object type, it will become:


Function.bindFunctionFunction({a:1})<br>Function.call.bindhasOwnPropertythisthishasOwnProperty

var mycall = function(thisArg, ...args) {
    let fn = this.bind(thisArg);
    return fn(...args)
}

var hasOwnKey2 = mycall.bind(Object.hasOwnProperty);
hasOwnKey2({ a: 1 }, 'b')
Menu