I was working on a task related to Custom Events
and was wondering, is there a difference between these methods apart from extra argument for event data
MDN - The old-fashioned way uses event.initEvent
but the polyfill on MDN - Cutom Events uses event.initCustomEvent
to initialize event.
I have referred Passing additional arguments in custom Event, but we can even use event.details
to set event data
.
JSFiddle - Event data with initEvent
So the question is, Is there any benefit of using specific one of them?