title: how to display socket io object values in client side?
body: <p><strong>hi i want to store userID,userName and socketId in to users array using object like this:</strong> </p>
  
  <pre><code>var userInfo = new Object();
              userInfo.userName = user.userName;
              userInfo.userId = user.userId;
              userInfo.socketId = socket.id;
              users.push(userInfo);
  </code></pre>
  
  <p>i created this object using this example <a href="https://stackoverflow.com/questions/7702461/socket-io-custom-client-id">link</a>.</p>
  
  <p>Now i want to display this object values (userName, userId,socketId) how can i display this values in to client side? </p>
  
  <p>i dont have any idea please help me</p>
  
  <pre><code>var app = require('express')();
  var http = require('http').Server(app);
  var io = require('socket.io')(http);
  var users = [];
  var roomName;
  app.get('/', function(req, res){
      res.sendFile(__dirname + '/index.html');
  });
  
  io.on('connection', function(socket){
      console.log('a user connected');
  
      socket.on('create', function (channel) {
          socket.join(channel);
          roomName=channel;
          socket.channel=channel;
          console.log('room', roomName);
      });
  
      socket.on('addUser', function (user) {
          var userInfo = new Object();
          userInfo.userName = user.userName;
          userInfo.userId = user.userId;
          userInfo.socketId = socket.id;
          users.push(userInfo);
          updateClients();
      });
  
      socket.on('chat message', function(msg){
  
      });
  
      socket.on('disconnect', function(){
  
      });
  
      function updateClients() {
          io.to(socket.channel).emit('update', users);
          console.log('users list is ', users);
      }
  });
  
  http.listen(3000, function(){
      console.log('listening on *:3000');
  });
  </code></pre>