Some questions about js debounce function

encountered a very confusing problem, because it needs to be used in the development of the shake,
so I wrote a function.

export function debounce(func, wait) {
  var timer
  return function (){
    console.log(timer)
    clearTimeout(timer)
    timer = setTimeout( function () {
      func(arguments)
    }, wait)
  }
}

is called in the place of the call:
onAfterChange= {debounce (this.onAfterChange.bind (this), 5000)}

then executed twice, this.onAfterChange. And timer was printed on it, and undefine was printed twice.

Jun.19,2021

doesn't know how you call it. Method is normal and will only be executed once (although this is not de-dithering but indefinitely delayed execution).

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-1b365b5-2bffc.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-1b365b5-2bffc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?