Note: This feature is available in Web Workers.
The ErrorEvent() constructor creates a new ErrorEvent object.
new ErrorEvent(type)
new ErrorEvent(type, options)typeA string with the name of the event. It is case-sensitive.
options OptionalAn object that, in addition of the properties defined in Event(), can have the following properties:
message OptionalA string containing a human-readable error message describing the problem.
filename OptionalA string containing the name of the script file in which the error occurred.
lineno OptionalAn integer containing the line number of the script file on which the error occurred.
colno OptionalAn integer containing the column number of the script file on which the error occurred.
error OptionalA JavaScript value, such as an Error or DOMException, representing the error associated with this event.
A new ErrorEvent object.