Difference between Events and Functions?

前端 未结 3 1967
情深已故
情深已故 2021-01-05 03:42

I am new to Node, and I am struggling to understand the main difference between Events and Functions. Both need to be triggered, so why do we need an Event at all if we have

3条回答
  •  無奈伤痛
    2021-01-05 04:26

    An event is an identifier used within tools (.on(), .emit() etc) to set and execute callbacks. Functions are reusable code.

提交回复
热议问题