Difference between event handlers and callbacks

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

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

12条回答
  •  [愿得一人]
    2020-12-22 17:16

    A callback is function(method) you pass as an argument to another function(method). The function(method) receiving the parameter can call it, or share it so some other function(method) in the system can call it.

    An event handler is a function(method) called when an event happens. It can be a callback.

提交回复
热议问题