On the problem of transmitting anonymous functions by requestAnimationFrame

fragment A

const moveHandler = function() {
  // do something...
}

dom.addEventListener("mousemove", function() {
  window.requestAnimationFrame(moveHandler)
})

is there any difference between the two writing methods? This is the problem I encountered when dragging a dom effect

Sep.10,2021

    In
  1. fragment A, you can use document.removeEventListener remove to drop the moveHandler event, but fragment B cannot;
  2. requestAnimationFrame whether it is an anonymous function or passing in a specific method, there is no difference

personally, I think it is more recommended to write segment A:

1. removeEventListener
2. 
3.  -- 

in terms of the effect achieved, there is no difference

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c22d19-32e6f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c22d19-32e6f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?