var options;
fetch("https://api.covid19api.com/countries").then(function(response) {
return response.json();
}).then(function(obj) {
options = "jas";
}).catch(function(error) {
alert(error);
});
console.log(options);
“ options”变量的值应该为“ jas”,但在控制台中显示为undefined。任何人都可以描述我在做什么和做错什么。
我要打印“ jas”,我该怎么做? 请帮助我