If the variable value is global why do i get undefined when i console.log() it out of socket.on('Led_1')? `
var io = require('socket.io-client');
var value;
var socket = io.connect('http://105.155.150.85/');
socket.on('Led_1',function(data){
value = data.message;
console.log(value); // Here it shows the value.
});
console.log(value); // here it shows undefined.
`