Skip to content

Instantly share code, notes, and snippets.

@topfunky
Created March 22, 2012 19:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save topfunky/2162851 to your computer and use it in GitHub Desktop.
Save topfunky/2162851 to your computer and use it in GitHub Desktop.
example of using instanceof
// NOTE: `app` parameter is an instance of Express.js.
module.exports = function(app) {
var socketIO;
socketIO = require('socket.io').listen(app);
socketIO.sockets.on('connection', function(socket) {
console.log("CONNECTED");
console.log(socket instanceof socket.constructor);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment