async function checkPlayersOnline() {
const response = await fetch("http://ip:port/dynamic.json");
const playersData = await response.json();
console.log(playersData.clients);
}
Is it possible to access the playersData inside another function? Example:
async function displayPlayers() {
console.log(playersData.clients);
}
When I attempt this, I get undefined as a result.