Code:
class MyEvent extends Event {
constructor(name) {
super(name);
}
}
var event = new MyEvent("mousemove");
Runtime error:
Uncaught TypeError: Failed to construct 'Event': Please use the 'new' operator, this DOM object constructor cannot be called as a function.
Is there a way around this?