The problem of bind binding in function

I encountered the problem of this pointing in the development. In addition to using the arrow function, I wondered if I could use bind to solve it. I made a mistake in binding when I used fn"s suggested way of writing, using the traditional way of writing ok. You can"t find out what the problem is on MDN

Mar.16,2021

personal guess:

 

var obj = {
func01: function () {},
func02 () {}
};

this should be the difference between the two writing methods.
func01 is defined when the line is executed, and function is defined when bind is executed, so there is no error in using bind.
while func02 is defined in the process of defining obj. When func02 is executed, the declaration of the function may not be finished, so calling the bind method will report an error

at this time.
Menu