Snippet of Code:
class CustomEvent extends Event {
constructor(name) {
super(name);
}
}
var customEvent = new CustomEvent("scroll");
Error Encountered During Runtime:
An error occurred: Uncaught TypeError: Failed to construct 'Event': Please make sure to use the 'new' operator, as this DOM object constructor cannot be invoked as a function.
Any possible workarounds for this issue?