The event to dispatch
Optional
The element to dispatch from, or will use window if none given.
window
Throws an error if the event is not a string that can be converted to a CustomEvent or not an instance of Event.
event
The event to dispatch