Doubts about Function.prototype.call.bind ()?

doubts about Object.prototype.hasOwnProperty.call (obj); `?

the first understanding: it can be understood here that the this of Object.prototype.hasOwnProperty is bound to the obj object through the call method, and is judged by this function at the same time?
the second understanding: but it seems to be that a obj object parameter is passed into the call method of Object.prototype.hasOwnProperty and runs inside the call method? But in that case, it looks like the call method is performing this judgment operation?

about Function.prototype.call.bind (Object.prototype.hasOwnProperty,obj); doubts?
understands the following code in the first way, but in the second way, I seem to understand it. Here, the this of the Function.prototype.call function is bound to Object.prototype.hasOwnProperty through bind, and the parameter obj is passed in, because the actual judgment is performed by the call function, while Object.prototype.hasOwnProperty provides a running environment.
but understand it this way. Then the related operations of objects that inherit the call method are done by the call method?
for example, Function.prototype.call.bind (Array.prototype.slice) intercepts the array by the call function?
then call,apply becomes a universal function?

Mar.08,2022

Object.prototype.hasOwnProperty.call (obj) is equivalent to obj.hasOwnProperty () , your first understanding

Function.prototype.call.bind (Object.prototype.hasOwnProperty,obj) as you said, it is equivalent to binding this, on Function.prototype.call and returning a function like this

function call(){
  Object.prototype.hasOwnProperty.call(obj)
}

but Function.prototype.call.bind (Array.prototype.slice) does return a call function bound to the Array.prototype.slice processing method, but what's the point of doing so?

  • Doubts about Function.prototype.call.bind ()?

    doubts about Object.prototype.hasOwnProperty.call (obj); `? the first understanding: it can be understood here that the this of Object.prototype.hasOwnProperty is bound to the obj object through the call method, and is judged by this function at...

    Mar.08,2022
  • Doubts about Function.prototype.call.bind ()?

    doubts about Object.prototype.hasOwnProperty.call (obj); `? the first understanding: it can be understood here that the this of Object.prototype.hasOwnProperty is bound to the obj object through the call method, and is judged by this function at...

    Mar.08,2022
  • Doubts about Function.prototype.call.bind ()?

    doubts about Object.prototype.hasOwnProperty.call (obj); `? the first understanding: it can be understood here that the this of Object.prototype.hasOwnProperty is bound to the obj object through the call method, and is judged by this function at...

    Mar.08,2022
Menu