Example of checking WebSocket.readyState for TradovateSocket?

I am quite new to Javascript.

There seems to be a read only property, WebSocket.readyState that would be very helpful for me. But I can’t seem to get the code to read it.

Could someone can give a short example of how to do it?