Difference between event handlers and callbacks

前端 未结 12 2526
时光说笑
时光说笑 2020-12-22 16:33

What is the difference between an event handler and a callback function?

12条回答
  •  一生所求
    2020-12-22 16:57

    Callback (from Wikipedia): "executable code that is passed as an argument to other code".
    Event handler (again from Wikipedia): "asynchronous callback subroutine that handles inputs received in a program".

    Which happens to be the way I've always understood it: an event handler is a very specific type of callback.

提交回复
热议问题