Created
March 22, 2012 19:50
-
-
Save topfunky/2162851 to your computer and use it in GitHub Desktop.
example of using instanceof
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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