1

From what I've understood reading about eventListener on MDN the third parameter is options, and across the network, I've seen people doing (event, action) and some do (event, action, false).

What I wonder is in the situation where no option are used is fine to go with the first version or there is some downside in performance?

volna
  • 2,452
  • 4
  • 25
  • 61
  • If the third parameter is `false` then use **bubbling**, if it is `true`, then use **capturing**. The terms bubbling and capturing are explained in the duplicate link. – ibrahim mahrir Jun 11 '17 at 18:33

1 Answers1

3
element.addEventListener(event, function, useCapture);

The third parameter is a boolean value specifying whether to use event bubbling or event capturing. This parameter is optional.

For more help: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener

user229044
  • 232,980
  • 40
  • 330
  • 338
Bhuwan
  • 16,525
  • 5
  • 34
  • 57