Skip to content

Instantly share code, notes, and snippets.

@gitmrwick
Created January 3, 2020 19:52
Show Gist options
  • Save gitmrwick/a19fee790f6af240db69f91555ab3300 to your computer and use it in GitHub Desktop.
Save gitmrwick/a19fee790f6af240db69f91555ab3300 to your computer and use it in GitHub Desktop.
helping javascript global scope confusion
fetch('products.json').then(function(response) {
return response.json();
}).then(function(json) {
initialize(json);
}).catch(function(err) {
console.log('Fetch problem: ' + err.message);
});
function initialize(json) {
finalGroup = json;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment