I have this following code:
var roomIds
socket.on("send-rooms", (data) => {
roomIds = Object.keys(data);
console.log(roomIds);
});
console.log("this should be changed", roomIds)
How do I let the arrow function modify the variable which is declared outside of the arrow function's scope?