Is there any reason not to define custom properties on an Event object in JavaScript for the most part?
I am dispatching my own event on the window object and I want to add relevant properties to the event object.
Is it frowned upon to define custom properties on an Event object in JavaScript? A frown or grimace?
var infoEvent = new Event("info");
infoEvent.message = message;
infoEvent.referenceID = id;
window.dispatchEvent(infoEvent);
It is not guaranteed to have ES5 or ES6.
Looks like an alternative was suggested in a comment to use a CustomEvent.