how i can use the result of this link in variable javascript :
https://aa.real-tv1.com/testtt.php?action=reseller_mapdash1
let url = 'https://aa.real-tv1.com/testtt.php?action=reseller_mapdash1';
var myVariable;
fetch(url).then(res => res.json()).then((out) => {
myVariable = out;
console.log([myVariable]);
}).catch(err => { throw err });
console.log([myVariable]);
so i know where is the problem now , when i use the variable 'myVariable'
outside a function i have Variable undefined
so how i can use the variabla outside a function ?