I was looking through this repository and noticed that the author had declared a variable (io) in app.js:
/* Socket.io Communication */
var io = require('socket.io').listen(server);
io.sockets.on('connection', socket);
He refers to the variable again in public/js/app.js, but doesn't seem to refer to the outer javascript file at all as I would normally expect, so I'm surprised this doesn't result in a ReferenceError.
Could someone please clarify for me what it is about this example that allows this external reference to io to work? Many thanks in advance.