First give a good code:
The second type Not bad either
The third one is more streamlined
The key is that setTimeout is the first This in the first parameter is window, so a more practical variable
is needed. It is not feasible to directly rely on this in setTimeout, because it points to window, which can be achieved by globalizing the node that wants to be processed.
Fengyan’s method is to pass in the correct this reference before setTimeout executes the countdown, and return a required package with the correct node reference.
is the execution function after setTimeout counts down. It doesn't matter whether the parameter name is me or Mes.