I am currently having a problem accessing emoji_map
outside of the then
scope and I don't know how to do it.
Here's my code:
if (req) {
fetch(req).then(function(response) {
return response.json();
}).then(function(response) {
/* start to observe */
emoji_map = response.emoji_map;
console.log(emoji_map);
});
}
When I do console.log(emoji_map); outside if loop I cannot access the response assigned. Can anyone help?