Web APIs
WebSocket.readyState
Numeric connection state, compared with the WebSocket state constants.
Formal Syntax & Structure
javascript syntaxjavascript
socket.readyStateReturn Value
number
Numeric connection state, compared with the WebSocket state constants.
Working Example
Example Snippetjavascript
(async () => {console.log([WebSocket.CONNECTING,WebSocket.OPEN,WebSocket.CLOSING,WebSocket.CLOSED].join(","));})()