CloseEvent() constructor creates a new
new CloseEvent(typeArg); new CloseEvent(typeArg, closeEventInit);
DOMStringrepresenting the name of the event.
CloseEventInitdictionary, having the following fields:
"wasClean", optional and defaulting to
false, of type
long, indicates if the connection has been closed cleanly or not.
"code", optional and defaulting to
0, of type
unsigned short, that is the connection close code sent by the server.
"reason", optional and defaulting to
'', of type
DOMString, that is a human-readable reason why the server closed the connection.
CloseEventInitdictionary also accepts fields from the
|HTML Standard (HTML)|
BCD tables only load in the browser
CloseEvent, the interface of the objects it constructs.