I was wondering whether there is a method that can let me print out value like this?
socket.emit('location', "Hostel");
socket.on('resultOfLocation', function(msg){
console.log(msg); //This can print out value successfully
});
console.log(msg); //Result is undefined. How can print out value at here?