Answer: First of all, there is no "open" method on the WebSocket object. However, when we want to create a WebSocket object for establishing a connection, we basically
instantiate the WebSocket object that does the trick.
e.g.
var uri ='ws://echo.websocket.org/';
var webSocket = new WebSocket(uri);
Asked In: Many Interviews |
Alert Moderator